Ejemplo n.º 1
0
def mozwebqa_logged_in(request):
    from pages.login_page import MozTrapLoginPage
    mozwebqa = request.getfuncargvalue('mozwebqa')
    login_pg = MozTrapLoginPage(mozwebqa)
    login_pg.go_to_login_page()
    login_pg.login()

    return mozwebqa
Ejemplo n.º 2
0
    def test_that_user_can_login_and_logout(self, mozwebqa, existing_user):
        from pages.login_page import MozTrapLoginPage
        login_pg = MozTrapLoginPage(mozwebqa)
        home_pg = MozTrapHomePage(mozwebqa)

        home_pg.get_relative_path('/')
        Assert.false(home_pg.header.is_user_logged_in)

        login_pg.go_to_login_page()
        login_pg.login(existing_user['email'], existing_user['password'])
        Assert.true(home_pg.header.is_user_logged_in)
        Assert.equal(home_pg.header.username_text, existing_user['name'])

        home_pg.header.click_logout()
        home_pg.get_relative_path('/')
        Assert.false(home_pg.header.is_user_logged_in)
Ejemplo n.º 3
0
    def test_that_user_can_login_and_logout(self, base_url, selenium,
                                            existing_user):
        from pages.login_page import MozTrapLoginPage
        login_pg = MozTrapLoginPage(base_url, selenium)
        home_pg = MozTrapHomePage(base_url, selenium)

        home_pg.get_relative_path('/')
        assert not home_pg.header.is_user_logged_in

        login_pg.go_to_login_page()
        login_pg.login(existing_user['email'], existing_user['password'])
        assert home_pg.header.is_user_logged_in
        assert existing_user['name'] == home_pg.header.username_text

        home_pg.header.click_logout()
        home_pg.get_relative_path('/')
        assert not home_pg.header.is_user_logged_in
Ejemplo n.º 4
0
    def test_that_user_can_login_and_logout(self, mozwebqa):
        from pages.login_page import MozTrapLoginPage
        login_pg = MozTrapLoginPage(mozwebqa)
        home_pg = MozTrapHomePage(mozwebqa)

        home_pg.get_relative_path('/')

        Assert.false(home_pg.header.is_user_logged_in)

        login_pg.go_to_login_page()
        login_pg.login()

        user = home_pg.testsetup.credentials['default']
        users_name = user['name']

        Assert.true(home_pg.header.is_user_logged_in)
        Assert.equal(home_pg.header.username_text, users_name)

        home_pg.header.click_logout()
        home_pg.get_relative_path('/')

        Assert.false(home_pg.header.is_user_logged_in)
Ejemplo n.º 5
0
 def login(self, email, password):
     self.find_element(*self._signin_locator).click()
     from pages.login_page import MozTrapLoginPage
     MozTrapLoginPage(self.base_url,
                      self.selenium).login(email, password)
Ejemplo n.º 6
0
 def click_logout(self):
     self.selenium.find_element(*self._logout_locator).click()
     from pages.login_page import MozTrapLoginPage
     return MozTrapLoginPage(self.testsetup)
Ejemplo n.º 7
0
def login(request, base_url, selenium, existing_user):
    from pages.login_page import MozTrapLoginPage
    login_pg = MozTrapLoginPage(base_url, selenium)
    login_pg.go_to_login_page()
    login_pg.login(existing_user['email'], existing_user['password'])
Ejemplo n.º 8
0
 def click_login(self, user='******'):
     self.find_element(*self._signin_locator).click()
     from pages.login_page import MozTrapLoginPage
     MozTrapLoginPage(self.testsetup).login(user)
Ejemplo n.º 9
0
 def login(self, email, password):
     self.find_element(*self._signin_locator).click()
     from pages.login_page import MozTrapLoginPage
     MozTrapLoginPage(self.testsetup).login(email, password)
Ejemplo n.º 10
0
def login(request, mozwebqa, existing_user):
    from pages.login_page import MozTrapLoginPage
    login_pg = MozTrapLoginPage(mozwebqa)
    login_pg.go_to_login_page()
    login_pg.login(existing_user['email'], existing_user['password'])