示例#1
0
    def testShouldCheckButtonsForAddonsInEditAndViewMode(self):
        #This test is to check that we should be able to see specific buttons in the edit mode of an addon.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        addonpage_obj = addon_editor_page.AddonEditorPage(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_addon_btn()
        loginpage_obj.login(username, password)

        #When signed in , check that the Test, Download, Save, Copy, Error Console, Revision, Properties button are present on the editor page
        self.assertTrue(addonpage_obj.check_test_btn_present())
        self.assertTrue(addonpage_obj.check_download_btn_present())
        self.assertTrue(addonpage_obj.check_save_btn_present())
        self.assertTrue(addonpage_obj.check_copy_btn_present())
        self.assertTrue(addonpage_obj.check_error_console_btn_present())
        self.assertTrue(addonpage_obj.check_revision_btn_present())
        self.assertTrue(addonpage_obj.check_properties_btn_present())

        homepage_obj.click_signout()
        homepage_obj.click_addon_view_btn()

        #After signout, the save and the error console button shoult not be present.
        self.assertTrue(addonpage_obj.check_test_btn_present())
        self.assertTrue(addonpage_obj.check_download_btn_present())
        self.assertTrue(addonpage_obj.check_copy_btn_present())
        self.assertTrue(addonpage_obj.check_revision_btn_present())
        self.assertTrue(addonpage_obj.check_properties_btn_present())
示例#2
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))
示例#3
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)
示例#4
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())
示例#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 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'
    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)
示例#8
0
    def test_automation(self):

        login = login_page.LoginPage(self.driver)
        login.do_login()

        home = home_page.HomePage(self.driver)
        #self.assertEqual(home.verify_home_page(), 'True')
        home.click_camera_icon()

        gallery = gallery_page.GalleryPage(self.driver)
        gallery.click_and_save_image()

        home = home_page.HomePage(self.driver)
        home.click_options_menu()

        options = options_page.OptionsPage(self.driver)
        options.swipe_to_bottom()
        options.log_out()
示例#9
0
    def test_automation(self):

        login = login_page.LoginPage(self.driver)
        login.do_login()

        home = home_page.HomePage(self.driver)
        self.assertEqual(home.verify_home_page(), 'True')
        home.click_avatar_button()

        gallery = gallery_page.GalleryPage(self.driver)
        gallery.click_and_save_image()

        home = home_page.HomePage(self.driver)
        home.click_profile_icon()

        profile = profile_page.ProfilePage(self.driver)
        profile.click_more_options()

        log_out = options_page.OptionsPage(self.driver)
        log_out.do_logout()
示例#10
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())
    def testShouldCreateLibrary(self):
        #This test is to check that we should be able to create a library.
        #Create page objects
        sel = self.driver
        homepage_obj = home_page.HomePage(sel)
        loginpage_obj = login_page.LoginPage(sel)
        libpage_obj = lib_editor_page.LibraryEditorPage(sel)

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

        #Click on creatae library button on homepage, login and check that the library name for the current library starts with "My Library"
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        loginpage_obj.login(username, password)
        lib_name = libpage_obj.get_lib_name()
        #self.assertEquals(addon_name.text, "regexp:"+account_name.text+".*")
        self.failUnless(re.match("My Library", lib_name))
示例#12
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())
 def return_to_home_page(self):
     self.browser.find_element_by_id("home_button").click()
     return home_page.HomePage(self.browser)