def test_user_create(self): module_logger.info('Starting BE Create User Test') # logs in and navigates to WP BE lpo = LoginPageObject(self.driver, self.base_url) lpo.do_login(test_info["login_username"], test_info["login_pword"]) module_logger.info('logged in') # navigates to WP Users page then clicks to create new user User_Menu_Bar(self.driver).site_admin() module_logger.info('@ WP BE') WpDb(self.driver).wp_users() module_logger.info('@ BE User Page') Wpusers(self.driver).add_new() module_logger.info('@ create user page') # enters the new user info anu = AddNewUser(self.driver) anu.username = test_info["test_username"] anu.email = test_info["new_email"] anu.pword = test_info["new_pword_strong"] anu.rep_pword = test_info["new_pword_strong"] anu.user_role(locators["nu_role_adviser"]) anu.project() anu.project_num = test_info["new_user_proj"] anu.project_choice() # navigates back to SBv3 FE WpUmb(self.driver).go_2_FE() module_logger.info('@ FE DB')
def test_prof_update_change_pword(self): module_logger.info('Started FE Update Profile / Change Password Test') up = UpdateProfile(self.driver) #changes password / logs out self.info_entry(up) self.password_entry(up) up.update_profile_submit() module_logger.info('profile updated') self.log_out() # logs in w/new password lpo = LoginPageObject(self.driver, self.base_url) lpo.username = test_info["login_username"] lpo.password = test_info["new_pword_strong"] lpo.submit() User_Menu_Bar(self.driver).profile() module_logger.info('logged in w/new password') # changes password back to original / verifies user can log back in using original password self.info_entry(up) up.current_pword = test_info["new_pword_strong"] up.new_pword = test_info["login_pword"] up.con_pword = test_info["login_pword"] up.update_profile_submit() self.log_out() self.log_in() module_logger.info( 'password set back to original. Change Password Test Complete ')
def test_update_proj(self): # log in module_logger.info('Started Update Project Test') lpo = LoginPageObject(self.driver, self.base_url) lpo.do_login(test_info["login_username"], test_info["login_pword"]) module_logger.info('Logged In') # navigates to project admin and waits for list to populate User_Menu_Bar(self.driver).proj_admin() module_logger.info('@ Project Admin Page') time.sleep(10) # searches for project / clicks to update / enters new proj name sp = SearchProject(self.driver) self.search_project(sp) up = UpdateProj(self.driver) up.proj_des = "Veggie Smurf School" up.update_submit() module_logger.info('back @ Project Admin Page') # re-searches for project and assets new proj name update was retained time.sleep(10) self.search_project(sp) module_logger.info('back @ Project Page') self.assertEquals( "Veggie Smurf School", self.driver.find_element_by_css_selector( locators["up_proj_des"]).get_attribute("value")) module_logger.info('Update Project Test Complete')
def test_create_project(self): module_logger.info('Started FE Create Project Test') # logs in and navigates to proj admin lpo = LoginPageObject(self.driver, self.base_url) lpo.do_login(test_info["login_username"], test_info["login_pword"]) module_logger.info('logged in') User_Menu_Bar(self.driver).proj_admin() module_logger.info('@ project admin page') # clicks create project and proceeds to do so CreateProject(self.driver).create_proj() cp = CreateProj(self.driver) module_logger.info('@ create proj page') cp.cust_num = test_info["cust_num"] cp.proj_num = test_info["proj_num"] cp.proj_name = test_info["proj_name"] cp.proj_des = test_info["proj_des"] cp.pg_num = test_info["proj_pg_ct"] cp.create_submit() module_logger.info('project created') # searches for newly created project then selects to update said project sp = SearchProject(self.driver) time.sleep(5) sp.project_search() sp.search = test_info["proj_num"] sp.proj_search_results() UpdateProject(self.driver).update_project() ## asserts that the newly created project's data is what was entered above module_logger.info('new project found') self.assertEquals( test_info["proj_des"], self.driver.find_element_by_css_selector( locators["cp_proj_des"]).get_attribute("value")) module_logger.info('Data is Correct. FE Create Project Test Complete')
def test_user_create(self): # logs in and navigates to FE User Manager module_logger.info('Starting FE Create User Test') ''' lpo = LoginPageObject(self.driver, self.base_url) lpo.username = test_info["login_username"] lpo.password = test_info["login_pword"] lpo.submit() ''' lpo = LoginPageObject(self.driver, self.base_url) lpo.do_login(test_info["login_username"], test_info["login_pword"]) module_logger.info('logged in') User_Menu_Bar(self.driver).user_manager() module_logger.info('@ user manager page') # Clicks to create a new user from the User Manager page then proceeds to create user um = UserManager(self.driver) um.um_create_user() module_logger.info('@ user manager create user page') cu = UmCreateUser(self.driver) cu.user_name = test_info["test_username"] cu.first_name = test_info["new_first_name"] cu.last_name = test_info["new_last_name"] cu.email = test_info["new_email"] cu.phone = test_info["new_phone"] cu.new_pword = test_info["new_pword_strong"] cu.con_pword = test_info["new_pword_strong"] cu.user_role(locators["um_role_adviser"]) cu.create_user_submit() time.sleep(10) um.um_search_user() um.um_search_field = test_info["new_first_name"] time.sleep(5) self.assertTrue( check_is_displayed_by_xpath(locators["um_search_results"]), "It wasn't true :(") module_logger.info('FE Create User Test complete')
def log_out(self): time.sleep(10) self.assertEqual("Admin Dashboard | Studio Balfour", self.driver.title) User_Menu_Bar(self.driver).dashboard_button() DashBoard(self.driver).log_out() module_logger.info('logged out')
def log_in(self): lpo = LoginPageObject(self.driver, self.base_url) lpo.do_login(test_info["login_username"], test_info["login_pword"]) module_logger.info('logged in') User_Menu_Bar(self.driver).profile() module_logger.info('@ FE Profile page')
def test_umb_links(self): # logs in module_logger.info('Started User Menu Bar Test') lpo = LoginPageObject(self.driver, self.base_url) lpo.username = test_info["login_username"] lpo.password = test_info["login_pword"] lpo.submit() module_logger.info('logged in') # proceeds to click the links all of the links dash = User_Menu_Bar(self.driver) dash.admin_db() module_logger.info('@ admin db') dash.user_admin() module_logger.info('@ user admin') dash.proj_admin() module_logger.info('@ project admin') dash.site_admin() module_logger.info('@ site admin') wpumb = WpUmb(self.driver) wpumb.go_2_FE() module_logger.info('@ FE DB') dash.dashboard_button() dash.user_manager() module_logger.info('@ user manager') dash.project() module_logger.info('@ project') dash.profile() module_logger.info('@ profile') dash.check_user_info() module_logger.info('@ check user info') dash.balfour_tools() module_logger.info('@ bt') dash.bt_faq() module_logger.info('@ bt faq') dash.my_year() module_logger.info('@ my year') dash.contact() module_logger.info('@ contact') dash.dashboard_button() module_logger.info('@ FE DB') DashBoard(self.driver).log_out() module_logger.info('logged out') module_logger.info('User Menu Bar Test Complete')