def test_validate_main_search(self): main_page = MainPage(self.driver) api_helper = ApiHelper() fake_data = self.helpers.generate_fake_data() email = fake_data["email"] f_name = "{} {}".format(fake_data["name_prefix"], fake_data["first_name"]) l_name = fake_data["last_name"] first_and_last_name = "{} {}".format(f_name, l_name) employee_id = fake_data["random_number"] body = { 'email': email, 'firstname': f_name, 'lastname': l_name, 'employeeId': employee_id } api_helper.make_http_request(method_type="POST", url_part="workers_creation", body=body) self.login() # search by first and last name main_page.specify_search(first_and_last_name) main_page.press_search_button() self.assertTrue( main_page.check_name_exist_in_grid(first_and_last_name)) # search by email main_page.clear_search_filed() main_page.specify_search(email) main_page.press_search_button() self.assertTrue( main_page.check_name_exist_in_grid(first_and_last_name)) # search by worker's employee id main_page.clear_search_filed() main_page.specify_search(employee_id) main_page.press_search_button() self.assertTrue( main_page.check_name_exist_in_grid(first_and_last_name))
def test_share_workers_to_another_employee(self): main_page = MainPage(self.driver) fake_data = self.helpers.generate_fake_data() recipient_name = fake_data["cert_name"] recipient_email = Config.api_second_login recipient_company_name = fake_data["random_phrase2"] project_name = fake_data["cert_name2"] comments = fake_data["random_phrase"] names_list = self.helpers.create_multiple_workers(5) self.login() main_page.click_on_checkbox_next_to_worker(1) main_page.click_on_checkbox_next_to_worker(2) main_page.click_on_checkbox_next_to_worker(3) main_page.click_on_checkbox_next_to_worker(4) main_page.click_on_checkbox_next_to_worker(5) main_page.click_share_team_button() main_page.fill_recipient_name_while_sharing(recipient_name) main_page.fill_recipient_email_while_sharing(recipient_email) main_page.fill_recipient_company_name_while_sharing( recipient_company_name) main_page.fill_project_name_while_sharing(project_name) main_page.fill_comments_for_recipient_while_sharing(comments) main_page.click_share_button() main_page.click_done_button() main_page.click_sign_out() self.login(Config.api_second_login) self.assertTrue(main_page.wait_for_grid_render()) main_page.click_shared_button() main_page.mark_checkboxes_in_shared_modal() main_page.click_apply_button_in_modals() main_page.wait_for_grid_render() self.assertTrue(main_page.check_name_exist_in_grid(names_list[0])) self.assertTrue(main_page.check_name_exist_in_grid(names_list[1])) self.assertTrue(main_page.check_name_exist_in_grid(names_list[2])) self.assertTrue(main_page.check_name_exist_in_grid(names_list[3])) self.assertTrue(main_page.check_name_exist_in_grid(names_list[4]))