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 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):
        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_assign_project(self):
     module_logger.info('Starting FE Assign Project 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')
     db = DashBoard(self.driver)
     db.db_project()
     db.db_project_search = test_info["project_search"]
     db.db_project_choice()
 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')
예제 #6
0
 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_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 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')