def test_success(self):
        self.browser.set_url(smokecfg['cssite'])
        self.loginpage = loginpage.LoginPage(self.browser.get_browser())

        # wait for at most 5 minutes, in case we have an anoyingly slow server
        shared.Shared.wait_for_element(self.browser.get_browser(),
                                       'class_name',
                                       'select-language',
                                       waittime=300)

        # language selection must be done before username and password
        self.loginpage.set_language(smokecfg['language'])

        shared.Shared.wait_for_element(self.browser.get_browser(),
                                       'class_name',
                                       'fields',
                                       waittime=300)

        self.loginpage.set_username(smokecfg['username'])
        self.loginpage.set_password(smokecfg['password'])
        self.loginpage.login()

        shared.Shared.wait_for_element(self.browser.browser, 'id',
                                       'navigation')

        time.sleep(3)

        self.dashboardpage = dashboardpage.DashboardPage(
            self.browser.get_browser())

        # navigate to Accounts page
        self.dashboardpage.navigate_to('accounts')

        # make sure we are on Accounts page
        activeitem = self.dashboardpage.get_active_item()
        if activeitem.find('accounts') < 0:
            self.assertRaises(ValueError, self.dashboardpage.get_active_item(),
                              activeitem)

        # now we are at Accounts page
        self.accountspage = accountspage.AccountsPage(
            self.browser.get_browser())
        self.accountspage.add_account(
            username=smokecfg['new user account']['username'],
            password=smokecfg['new user account']['password'],
            email=smokecfg['new user account']['email'],
            firstname=smokecfg['new user account']['firstname'],
            lastname=smokecfg['new user account']['lastname'],
            domain=smokecfg['new user account']['domain'],
            type=smokecfg['new user account']['type'],
            timezone=smokecfg['new user account']['timezone'],
        )
        self.loginpage.logout()

        shared.Shared.wait_for_element(self.browser.browser, 'class_name',
                                       'login')
Ejemplo n.º 2
0
    def test_success(self):
        self.browser.set_url(smokecfg['cssite'])
        self.loginpage = loginpage.LoginPage(self.browser.get_browser())
        # language selection must be done before username and password
        self.loginpage.set_language(smokecfg['language'])
        self.loginpage.set_username(smokecfg['username'])
        self.loginpage.set_password(smokecfg['password'])
        self.loginpage.login()
        shared.Shared.wait_for_element(self.browser.browser, 'id',
                                       'navigation')

        time.sleep(3)

        self.dashboardpage = dashboardpage.DashboardPage(
            self.browser.get_browser())
        active_item = self.dashboardpage.get_active_item()
        print "active item: ", active_item

        self.loginpage.logout()
        shared.Shared.wait_for_element(self.browser.browser, 'class_name',
                                       'login')
Ejemplo n.º 3
0
    def test_success(self):
        self.browser.set_url(smokecfg['cssite'])
        self.loginpage = loginpage.LoginPage(self.browser.get_browser())

        # wait for at most 5 minutes, in case we have an anoyingly slow server
        shared.Shared.wait_for_element(self.browser.get_browser(),
                                       'class_name',
                                       'select-language',
                                       waittime=300)

        # language selection must be done before username and password
        self.loginpage.set_language(smokecfg['language'])

        shared.Shared.wait_for_element(self.browser.get_browser(),
                                       'class_name',
                                       'fields',
                                       waittime=300)

        self.loginpage.set_username(smokecfg['username'])
        self.loginpage.set_password(smokecfg['password'])
        self.loginpage.login()

        shared.Shared.wait_for_element(self.browser.browser, 'id',
                                       'navigation')

        time.sleep(3)

        self.dashboardpage = dashboardpage.DashboardPage(
            self.browser.get_browser())

        items = self.dashboardpage.get_items()
        [self.dashboardpage.navigate_to(item) for item in items]

        self.loginpage.logout()

        shared.Shared.wait_for_element(self.browser.browser, 'class_name',
                                       'login')