示例#1
0
    def test_addPage(self):
        print('=== Add a page test ===')
        newPageName = "New page"

        print('Enter customizing mode')
        mainPage.enterCustomizingMode(self.browser)

        print('Open add page modal')
        pagesMenuBar = mainPage.getPagesMenuBar(self.browser)
        pagesMenuBar.getAddPageButton().click()
        addPageModal = mainPage.waitAddPageModal(self.browser)

        print('Create the page')
        addPageModal.enterPageName(newPageName)
        addPageModal.ok()

        print('Check page was created (customizing mode)')
        self.assertEqual(pagesMenuBar.getPagesCount(), 2)
        self.assertEqual(pagesMenuBar.getPage(1).getName(), newPageName)

        print('Exit customizing mode')
        mainPage.exitCustomizingMode(self.browser)

        print('Check page was created (normal mode)')
        pagesMenuBar = mainPage.getPagesMenuBar(self.browser)
        self.assertEqual(pagesMenuBar.getPagesCount(), 2)
        self.assertEqual(pagesMenuBar.getPage(1).getName(), newPageName)
示例#2
0
    def test_cancelAddPage(self):
        print('=== Entering/Exiting customization test ===')

        print('Enter customizing mode')
        mainPage.enterCustomizingMode(self.browser)

        print('Open add page modal')
        mainPage.getPagesMenuBar(self.browser).getAddPageButton().click()
        addPageModal = mainPage.waitAddPageModal(self.browser)
        print('Cancel add page modal')
        addPageModal.cancel()

        print('Exit customizing mode')
        mainPage.exitCustomizingMode(self.browser)
示例#3
0
    def test_refreshPageOptionDisable(self):
        print '=== RefreshPage option (disabled) test ==='

        print 'Open systemConfiguration dashboard'
        dashboard.open(self.browser)
        dashboard.openSystemConfiguration(self.browser)

        print 'Disable RefreshPage option'
        advancedParameterSection = dashboard.systemConfiguration.enableAdvancedParametersSection(
            self.browser)
        dashboard.systemConfiguration.setRefreshPageOption(
            advancedParameterSection, False)
        dashboard.systemConfiguration.applySystemConfiguration(self.browser)
        dashboard.close(self.browser)

        print 'Create 3 more pages (for a total of 4 pages)'
        mainPage.addPage(self.browser, "Page 1")
        mainPage.addPage(self.browser, "Page 2")
        mainPage.addPage(self.browser, "Page 3")

        welcomePageTitle = i18n.get()["initialization"]["homePage"]

        print 'Select page 2 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 2")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            welcomePageTitle)

        print 'Select page 3 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 3")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            welcomePageTitle)

        print 'Select page 1 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 1")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            welcomePageTitle)
示例#4
0
    def test_refreshPageOptionEnable(self):
        print '=== RefreshPage option (enabled) test ==='

        print 'Open systemConfiguration dashboard'
        dashboard.open(self.browser)
        dashboard.openSystemConfiguration(self.browser)

        print 'Enable RefreshPage option'
        advancedParameterSection = dashboard.systemConfiguration.enableAdvancedParametersSection(
            self.browser)
        dashboard.systemConfiguration.setRefreshPageOption(
            advancedParameterSection, True)
        dashboard.systemConfiguration.applySystemConfiguration(self.browser)
        dashboard.close(self.browser)

        print 'Create 3 more pages (for a total of 4 pages)'
        mainPage.addPage(self.browser, "Page 1")
        mainPage.addPage(self.browser, "Page 2")
        mainPage.addPage(self.browser, "Page 3")

        print 'Select page 2 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 2")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            "Page 2")

        print 'Select page 3 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 3")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            "Page 3")

        print 'Select page 1 and refresh'
        mainPage.getPagesMenuBar(self.browser).selectPage("Page 1")
        self.browser.refresh()
        self.assertEqual(
            mainPage.getPagesMenuBar(self.browser).getCurrentPage().getName(),
            "Page 1")