def test_language_switcher(browser, server): if 'localhost' in server: pytest.skip() browser.get('{}en'.format(server)) for lang, lang_name in languages.items(): select = Select(browser.find_element_by_xpath("//select[@name='lang']")) select.select_by_visible_text(lang_name) assert browser.current_url == '{}{}/'.format(server, lang) assert test_basic_params[lang] in browser.find_element_by_tag_name('body').text
def test_language_switcher(browser, server): if 'localhost' in server: pytest.skip() browser.get(f'{server}en/') for lang, lang_name in languages.items(): select = Select( browser.find_element(By.XPATH, "//select[@name='lang']")) select.select_by_visible_text(lang_name) assert browser.current_url == f'{server}{lang}/' assert test_basic_params[lang] in browser.find_element( By.TAG_NAME, 'body').text