Пример #1
0
    def test_step1_login_as_admin(self, browser, baseurl):
        page_object = LoginPage(browser, baseurl)
        page_object.go_to_url()

        page_object.go_to_login_form()
        page_object.log_in("admin", "admin123")

        page_object = LoggedInPage(browser, baseurl)

        assert page_object.is_logged()
Пример #2
0
    def test_step1_login_as_user(self, browser, baseurl):
        page_object = LoginPage(browser, baseurl)
        page_object.go_to_url()

        page_object.go_to_login_form()
        page_object.log_in("developer", "passw0rd")

        page_object = LoggedInPage(browser, baseurl)

        assert page_object.is_logged()
Пример #3
0
    def test_step3_login(self, browser, baseurl, admin_login, admin_password):
        page_object = LoginPage(browser, baseurl)
        page_object.go_to_url()

        page_object.go_to_login_form()
        page_object.log_in(admin_login, admin_password)

        page_object = LoggedInPage(browser, baseurl)

        assert page_object.is_logged()
Пример #4
0
    def login(self, browser, baseurl, username, password):
        page_object = LoginPage(browser, baseurl)
        page_object.go_to_url()

        page_object.go_to_login_form()
        page_object.log_in(username, password)

        page_object = LoggedInPage(browser, baseurl)

        assert page_object.is_logged()
Пример #5
0
    def test_step3_go_to_administration(self, browser, baseurl):
        page_object = LoggedInPage(browser, baseurl)
        page_object.go_to_site_admin()

        assert page_object.get_section_heading().text == "Administrator's Toolbox :: Preferences"
Пример #6
0
 def test_step2_has_admin_privileges(self, browser, baseurl):
     page_object = LoggedInPage(browser, baseurl)
     assert page_object.has_admin_privileges()
Пример #7
0
 def test_step5_logout(self, browser, baseurl):
     page_object = LoggedInPage(browser, baseurl)
     page_object.logout()
Пример #8
0
 def test_step2_user_has_not_admin_privileges(self, browser, baseurl):
     with pytest.raises(NoSuchElementException):
         page_object = LoggedInPage(browser, baseurl)
         page_object.has_admin_privileges()