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)
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())