示例#1
0
    def testAddonCount(self):
        #This test is to assert that the count of the addons on dashboard is equal to the number of addons present on the page.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())

        #Get the total count of the number of add-ons that are displayed on the dashboard.
        #homepage_obj.click_myaccount()
        addon_count = dashboardpage_obj.calc_total_addons()

        #Get the number of addons that are displayed on the left hand side of the page.(Something like your add-ons(20))
        counter = dashboardpage_obj.get_addons_count()
        counter = string.lstrip(counter, '(')
        counter = string.rstrip(counter, ')')

        #Assert that the total addons on the page matches the counter on the left hand side.
        self.assertEquals(str(addon_count), str(counter))
示例#2
0
    def testShouldCheckLibraryLabel(self):
        #This test is to check the labels of a library on the dashboard
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        libpage_obj = lib_editor_page.LibraryEditorPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        #Create a library. Then go to dashoard and assert that the label is 'initial'.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        loginpage_obj.login(username, password)
        lib_name = libpage_obj.get_lib_name()
        homepage_obj.click_myaccount()
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())
        label_name = dashboardpage_obj.get_lib_label_name()
        self.assertEqual("initial", label_name.text)

        #Click on the edit button of the library.Then create a copy of that library and assert that the label is 'copy'
        dashboardpage_obj.navigate_to_lib_editor()
        libpage_obj.click_copy_btn()
        copy_lib_name = libpage_obj.get_lib_name()
        try:
            self.assertNotEqual(lib_name, copy_lib_name)
        except:
            print 'A copy of the addon could not be created'
        homepage_obj.click_myaccount()
        label_name = dashboardpage_obj.get_lib_label_name()
        self.assertEqual("copy", label_name.text)
示例#3
0
    def testShouldCheckDisableButtonPresentAfterSignin(self):
        #This test case should be run only after create addon and create library test case
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        homepage_obj.go_to_home_page()

        #Check that the disable button are not present for addon and library.
        self.assertFalse(homepage_obj.check_addon_disable_btn_present())
        self.assertFalse(homepage_obj.check_lib_disable_btn_present())

        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())
        homepage_obj.go_to_home_page()

        #Check that the disable button should be present now for addon and library
        self.assertTrue(homepage_obj.check_addon_disable_btn_present())
        self.assertTrue(homepage_obj.check_lib_disable_btn_present())
 def testLibraryPagination(self):
     #This test is to assert that if the count of the libraries on dashboard is more than 10, then the libraries should be paginated on public libraries page.
     #Create page objects
     sel = self.driver
     homepage_obj = home_page.HomePage(sel)
     loginpage_obj = login_page.LoginPage(sel)
     dashboardpage_obj = dashboard_page.DashboardPage(sel)
     public_page_obj = dashboard_public_page.DashboardPublicPage(sel)
     
     user_info = fd_login_data.FDLoginData().getLoginInfo()
     username = user_info['username']
     password = user_info['password']
 
     homepage_obj.go_to_home_page()
     homepage_obj.click_signin()
     loginpage_obj.login(username, password)
     self.assertEqual("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())
     
     #Get the total count of the number of add-ons that are displayed on the dashboard.
     #homepage_obj.click_myaccount()
     lib_count = dashboardpage_obj.calc_total_libs()
     
     if lib_count>10:
     #If there are more than 10 addons on the dashboard, go to the public addons page and check that the next button is present for pagination
         dashboardpage_obj.go_to_public_libs_page()
         self.assertTrue(public_page_obj.check_next_button_present())
     else:
         print 'Total Libraries are less then 10, so there will be no pagination'
示例#5
0
    def testShouldCreateAddOn(self):
        #This test is to check that we should be able to create an addon.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        addonpage_obj = addon_editor_page.AddonEditorPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        #Click on sign-in link on homepage, enter the username and password, and assert that you are on the dashboard page
        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())

        #Get the account name displayed on the dashboard
        account_name = dashboardpage_obj.get_account_name()
        homepage_obj.go_to_home_page()

        #Click on create addon button on homepage and compare the addon name should be same as account name
        homepage_obj.click_create_addon_btn()
        addon_name = addonpage_obj.get_addon_name()
        self.failUnless(re.match(account_name, addon_name))
    def testShouldCheckLibDelete(self):

        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        addonpage_obj = addon_editor_page.AddonEditorPage(sel)
        libpage_obj = lib_editor_page.LibraryEditorPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        homepage_obj.go_to_home_page()

        homepage_obj.click_create_lib_btn()
        loginpage_obj.login(username, password)
        #Get the name of the library on the editor page.
        lib_name = libpage_obj.get_lib_name()

        #Go the the dashboard and delete the library that you just created. Then check that the library at the top of the list is not the same as the one you just deleted.
        homepage_obj.click_myaccount()
        top_lib_name = dashboardpage_obj.get_top_lib_name()
        dashboardpage_obj.click_lib_delete()
        dashboardpage_obj.confirm_delete()
        top_lib_name_after_delete = dashboardpage_obj.get_top_lib_name()
        self.assertNotEquals(top_lib_name, top_lib_name_after_delete)

        #Go to homepage and create a new library and check that its name is the same as the one that was just deleted.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        new_lib_name = libpage_obj.get_lib_name()
        self.assertEquals(new_lib_name, lib_name)
示例#7
0
    def testShouldCheckLibButtonsPresent(self):
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        username = "******"
        password = "******"

        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())

        #On the dashboard, check that the library has ""Edit", Delete", "Public" and "Private" button present
        self.assertTrue(dashboardpage_obj.check_lib_edit_btn_present())
        self.assertTrue(dashboardpage_obj.check_lib_delete_btn_present())
        self.assertTrue(dashboardpage_obj.check_lib_public_btn_present())
        self.assertTrue(dashboardpage_obj.check_lib_private_btn_present())
示例#8
0
    def testShouldCheckAddonButtonsPresent(self):
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())

        #On the dashboard, check that the addon has "Test", "Edit", Delete", "Public" and "Private" button present
        self.assertTrue(dashboardpage_obj.check_addon_test_btn_present())
        self.assertTrue(dashboardpage_obj.check_addon_edit_btn_present())
        self.assertTrue(dashboardpage_obj.check_addon_delete_btn_present())
        self.assertTrue(dashboardpage_obj.check_addon_public_btn_present())
        self.assertTrue(dashboardpage_obj.check_addon_private_btn_present())
    def testShouldCheckLibDeactivateAndActivate(self):
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        privatepage_obj = dashboard_private_page.DashboardPrivatePage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)
        self.assertEqual("Dashboard - Add-on Builder",
                         dashboardpage_obj.get_page_title())

        #Get the name of the library present at the top of the library list on dashboard.
        #This will be used to compare whether the library is removed from the top of list after making it private
        lib_name = dashboardpage_obj.get_top_lib_name()

        #Click on the private button to make it private and then check that the library is not in the list anymore
        dashboardpage_obj.click_lib_mkprivate_btn()
        new_top_lib_name = dashboardpage_obj.get_top_lib_name()
        self.assertNotEqual(lib_name, new_top_lib_name)
        dashboardpage_obj.go_to_private_libs_page()

        #Go to the private libraries page and check that the library that you just made private is present there.
        #Click on public to make it public and check on the dashboard that the library is present there.
        priv_lib_name = privatepage_obj.get_top_lib_name()
        #text_priv_addon = priv_addon_name.text
        #print text_priv_addon
        self.assertEquals(lib_name, priv_lib_name)
        privatepage_obj.click_lib_mkpublic_btn()
        new_priv_top_lib_name = privatepage_obj.get_top_lib_name()
        self.assertNotEqual(priv_lib_name, new_priv_top_lib_name)
        privatepage_obj.go_to_dashboard()
        top_lib = dashboardpage_obj.get_top_lib_name()
        self.assertEquals(priv_lib_name, top_lib)
    def testAddonPropertiesEditSave(self):
        #This test is to assert that the properties of an addon can be edited and changes are retained after save.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)
        public_page_obj = dashboard_public_page.DashboardPublicPage(sel)
        addonpage_obj = addon_editor_page.AddonEditorPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']

        name = 'test'
        description = 'Description_test'

        homepage_obj.go_to_home_page()
        homepage_obj.click_create_addon_btn()
        loginpage_obj.login(username, password)

        #Edit the properties, save the addon and then check that the changes have been retained. Delete the addon at the end of the process.
        addon_name = addonpage_obj.get_addon_name()
        addonpage_obj.open_addon_properties()
        addonpage_obj.edit_fields(name, description, version)
        addonpage_obj.open_addon_properties()
        new_name = addonpage_obj.get_property_addon_name()
        #print new_name
        desc = addonpage_obj.get_addon_description()
        #print desc
        self.assertNotEquals(addon_name, new_name)
        self.assertEquals(description, desc.text)

        homepage_obj.click_myaccount()
        dashboardpage_obj.click_addon_delete()
        dashboardpage_obj.confirm_delete()
    def testShouldSignInToShowDashboard(self):
        #This test is to check that the user should be directed to the dashboard page after signing in.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        dashboardpage_obj = dashboard_page.DashboardPage(sel)

        user_info = fd_login_data.FDLoginData().getLoginInfo()
        username = user_info['username']
        password = user_info['password']
        
        #Click on sign-in link on homepage and enter the username and password
        homepage_obj.go_to_home_page()
        homepage_obj.click_signin()
        loginpage_obj.login(username, password)

        #Check for the title of the page to confirm that we are on the dashboard page.
        self.assertEqual("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())
        
        #Now we need to check that when the user is logged in, he should see a My Account link on the home page and clicking on that link should take him to the dashboard.
        dashboardpage_obj.navigate_to_homepage()
        homepage_obj.click_myaccount()
        self.assertEqual("Dashboard - Add-on Builder", dashboardpage_obj.get_page_title())