<s> import pytest <EOL> from pages . desktop . knowledge_base_new_article import KnowledgeBaseNewArticle <EOL> from pages . desktop . questions_page import AskNewQuestionsPage <EOL> from pages . desktop . questions_page import QuestionsPage <EOL> from pages . desktop . refine_search_page import RefineSearchPage <EOL> from pages . desktop . search_page import SearchPage <EOL> from pages . desktop . support_home_page import SupportHomePage <EOL> from mocks . mock_article import MockArticle <EOL> class TestLoginLogout : <EOL> @ pytest . mark . nondestructive <EOL> def test_login ( self , base_url , selenium , variables ) : <EOL> user = variables [ '<STR_LIT>' ] [ '<STR_LIT:default>' ] <EOL> page = SupportHomePage ( base_url , selenium ) . open ( ) <EOL> page . sign_in ( user [ '<STR_LIT:username>' ] , user [ '<STR_LIT:password>' ] ) <EOL> assert page . header . is_user_logged_in , '<STR_LIT>' <EOL> @ pytest . mark . native <EOL> @ pytest . mark . nondestructive <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ <EOL> SupportHomePage , <EOL> AskNewQuestionsPage , <EOL> QuestionsPage , <EOL> SearchPage , <EOL> RefineSearchPage , <EOL> ] ) <EOL> def test_logout_from_pages ( self , base_url , selenium , variables , page_object ) : <EOL> user = variables [ '<STR_LIT>' ] [ '<STR_LIT:default>' ] <EOL> page = page_object ( base_url , selenium ) . open ( ) <EOL> page . sign_in ( user [ '<STR_LIT:username>' ] , user [ '<STR_LIT:password>' ] ) <EOL> assert page . header . is_user_logged_in , '<STR_LIT>' <EOL> page . sign_out ( ) <EOL> assert page . canonical_url in selenium . current_url <EOL> assert page . header . is_user_logged_out <EOL> @ pytest . mark . native <EOL> def test_logout_from_new_kb_article_page ( self , base_url , selenium , variables ) : <EOL> user = variables [ '<STR_LIT>' ] [ '<STR_LIT:default>' ] <EOL> page = KnowledgeBaseNewArticle ( base_url , selenium ) . open ( <EOL> user [ '<STR_LIT:username>' ] , user [ '<STR_LIT:password>' ] ) <EOL> assert page . header . is_user_logged_in , '<STR_LIT>' <EOL> login_page = page . sign_out ( ) <EOL> assert login_page . canonical_url in selenium . current_url <EOL> assert login_page . header . is_user_logged_out <EOL> @ pytest . mark . native <EOL> def test_logout_from_edit_kb_article_page ( self , base_url , selenium , variables ) : <EOL> user = variables [ '<STR_LIT>' ] [ '<STR_LIT:default>' ] <EOL> kb_new_article = KnowledgeBaseNewArticle ( base_url , selenium ) . open ( <EOL> user [ '<STR_LIT:username>' ] , user [ '<STR_LIT:password>' ] ) <EOL> mock_article = MockArticle ( ) <EOL> kb_new_article . set_article ( mock_article ) <EOL> kb_new_article . submit_article ( ) <EOL> kb_article_history = kb_new_article . set_article_comment_box ( mock_article [ '<STR_LIT>' ] ) <EOL> kb_edit_article = kb_article_history . navigation . click_edit_article ( ) <EOL> login_page = kb_edit_article . sign_out ( ) <EOL> assert login_page . canonical_url in selenium . current_url <EOL> assert login_page . header . is_user_logged_out <EOL> @ pytest . mark . native <EOL> def test_logout_from_translate_kb_article_page ( self , base_url , selenium , variables ) : <EOL> user = variables [ '<STR_LIT>' ] [ '<STR_LIT:default>' ] <EOL> kb_new_article = KnowledgeBaseNewArticle ( base_url , selenium ) . open ( <EOL> user [ '<STR_LIT:username>' ] , user [ '<STR_LIT:password>' ] ) <EOL> mock_article = MockArticle ( ) <EOL> kb_new_article . set_article ( mock_article ) <EOL> kb_new_article . submit_article ( ) <EOL> kb_article_history = kb_new_article . set_article_comment_box ( mock_article [ '<STR_LIT>' ] ) <EOL> kb_translate_pg = kb_article_history . navigation . click_translate_article ( ) <EOL> kb_translate_pg . click_translate_language ( '<STR_LIT>' ) <EOL> login_page = kb_translate_pg . sign_out ( ) <EOL> login_page . url_kwargs [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> assert login_page . canonical_url in selenium . current_url <EOL> assert login_page . header . is_user_logged_out </s>
