def test_german_to_german_cookies():
"""
service_args: to prevent ssl v3 error
cookies[len(cookies) - 1].get("value"): because the value of the language is always a dictionary
at the last place of cookies.
:return: Test in the cookies if the language changed from german to german
"""
driver = webdriver.PhantomJS(service_args=["--ignore-ssl-errors=true"])
driver.get(ROOT + PATH + LANGUAGE["GERMAN"])
driver.get(ROOT)
driver.refresh()
try:
cookies = driver.get_cookies()
language_value = cookies[len(cookies) - 1].get("value")
if language_value is not None:
assert_in(LANGUAGE["GERMAN"], language_value)
assert_not_in(LANGUAGE["ENGLISH"], language_value)
else:
raise Exception("Cookie language value is empty")
finally:
driver.close()
评论列表
文章目录