def test_bICL_ADMIN_TOOL_ROLE_TEMPLATES_Confirm_text_does_not_display(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T329' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "DEV" baseURL_Admin = Environments_ADMIN.return_environments(env) time.sleep(1) # Assemble Admin URL String with User Creds parse_object = urlparse(baseURL_Admin) fdqm = parse_object.netloc base_url = "https://" + username + ":" + password + "@" + fdqm # Navigate to Admin Page using Admin URL String driver.get(base_url) driver.maximize_window() # Navigate to Users screen_to_navigate_to_1 = "Users" screen_1 = Screens.return_screens(screen_to_navigate_to_1) # Get Current URL current_url = driver.current_url # Concatenate current URL with Screen to Navigate to nav_string_1 = current_url + screen_1 # Go to Location driver.get(nav_string_1) adm = admin(driver) time.sleep(3) # search for user account adm.enter_user_account_click_search(test_data1) time.sleep(3) # Scroll Down Page gp = generic_page(driver) gp.scroll_down() time.sleep(3) adm.check_uncheck_site_status() adm.check_uncheck_replay() # Save adm.click_save() # Set to 10 Or Greater time.sleep(20) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) time.sleep(3) # Navigate to Role Templates screen_to_navigate_to_2 = "Role_Templates" screen_2 = Screens.return_screens(screen_to_navigate_to_2) # Get Current URL current_url = driver.current_url # Concatenate current URL with Screen to Navigate to nav_string_2 = current_url + screen_2 # Go to Location driver.get(nav_string_2) time.sleep(5) # Navigate back to Users; Confirm Site Status & Replay Display driver.get(nav_string_1) time.sleep(3) # search for user account adm.enter_user_account_click_search(test_data1) # Set to 10 Or Greater time.sleep(20) # Attempt to Click "Replay Feature" Link adm.validate_replay_link_displays(test_case_ID, browser, env, time_stamp) time.sleep(5) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Navigate back to Users; Confirm Site Status & Replay Display driver.get(nav_string_1) time.sleep(5) # Reset User Configuration to Original Setting # search for user account adm.enter_user_account_click_search(test_data1) time.sleep(3) gp.scroll_down() time.sleep(3) adm.check_uncheck_site_status() adm.check_uncheck_replay() # Save adm.click_save() time.sleep(20) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T369' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() time.sleep(5) # Login to Site lp = LoginPage(driver) # Verify if page loads (username_field should be clickable), if not, throw exception and take screenshot lp.verify_username_field_displays(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(15) # Click Housekeeping dp.click_housekeeping_icon() time.sleep(15) h = housekeeping(driver) time.sleep(5) # Click MF Questionnaire Mgr # h.click_mf_questionnaire_mgr() # Navigation Workaround current_url = driver.current_url slashparts = current_url.split('/') bbu = build_base_url() home_index_string = bbu.return_home_index_string() nav_url = '/'.join(slashparts[:3]) + home_index_string screen_to_navigate_to_1 = "housekeeping_mf_questionnaire_MGR" screen = Screens.return_screens(screen_to_navigate_to_1) nav_string = nav_url + screen driver.get(nav_string) time.sleep(15) # Validate that correct panel displays (correct title displays on screen) gp.validate_correct_text_displays(test_data1, test_case_ID, browser, env, time_stamp) time.sleep(5) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Click User Drop Down (on BICL Default Page) dp.click_user_drop_down() udd = user_drop_down(driver) udd.click_logout() # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(5) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T54' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() time.sleep(5) # Login to Site lp = LoginPage(driver) # Verify if page loads (username_field should be clickable), if not, throw exception and take screenshot lp.verify_username_field_displays(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(15) # Enter Account Number and click Search dp.enter_account_number_search(account_number) time.sleep(15) # Click Tools dp.click_tools_icon() time.sleep(15) t = tools(driver) # Click FOLIODX t.click_foliodx() time.sleep(5) # switch to opened window driver.switch_to.window(driver.window_handles[1]) time.sleep(5) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Close new Window driver.close() # Switch to First Window (Broker Insight) driver.switch_to.window(driver.window_handles[0]) # LOGOUT Section # Force Logout # Logout Workaround # Get current URL string, find base URL # Add logout_string to base_url to force logout current_url = driver.current_url slashparts = current_url.split('/') # Now join back the first three sections 'http:', '' and 'example.com' base_url = '/'.join(slashparts[:3]) + '/' logout_string = "user/login?logout=1" logout_screen = base_url + logout_string # Navigate to Logout Screen driver.get(logout_screen) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(5) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T386' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() time.sleep(5) # Login to Site lp = LoginPage(driver) # Verify if page loads (username_field should be clickable), if not, throw exception and take screenshot lp.verify_username_field_displays(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(15) # Enter Account Number and click Search dp.enter_account_number_search(account_number) time.sleep(15) # Verify if account icon can be clicked, if not, throw exception and take screenshot dp.verify_account_icon_clickable(test_case_ID, browser, env, time_stamp) # Click Menu Hamburger dp.click_menu_hamburger() time.sleep(5) hm = hamburger_menu(driver) # Click Account on Hamburger Menu hm.click_account() time.sleep(5) # Open Distributions hm.select_distributions() time.sleep(5) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(5) # LOGOUT Section # Click User Drop Down (on BICL Default Page) dp.click_user_drop_down() time.sleep(2) # Click Logout udd = user_drop_down(driver) udd.click_logout() # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T342' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() time.sleep(5) # Login to Site lp = LoginPage(driver) lp.login(username, password) lp.click_login_button() time.sleep(10) gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(3) # Enter Account Number and click Search dp.enter_account_number_search(account_number) time.sleep(5) # Navigate to Account Info using URL String a = account(driver) # Click Account Info a.click_account_info() time.sleep(10) ai = account_info(driver) # Account Info Screen # Select "Documents" from VIEW Drop Down ai.select_documents() time.sleep(1) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) ddd = document_drop_down(driver) # Select OPEN ORDER CONFIRMS ddd.select_confirms() time.sleep(10) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(15) # Switch to the IFrame Containing the Document driver.switch_to.frame(0) # Take Screenshot 4 screenshot_number = "4" time_stamp_4 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_4, screenshot_number, env, time_stamp_4) time.sleep(15) # Logout # Force Logout # Logout Workaround # Get current URL string, find base URL # Add logout_string to base_url to force logout current_url = driver.current_url slashparts = current_url.split('/') # Now join back the first three sections 'http:', '' and 'example.com' base_url = '/'.join(slashparts[:3]) + '/' logout_string = "user/login?logout=1" logout_screen = base_url + logout_string # Navigate to Logout Screen driver.get(logout_screen) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T242' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "PROD" baseURL = Environments_BICL.return_environments(env) driver.get(baseURL) driver.maximize_window() # Search for User Account time.sleep(5) # Login to Site lp = LoginPage(driver) # Verify if page loads (username_field should be clickable), if not, throw exception and take screenshot lp.verify_username_field_displays(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(1) gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(60) # Enter Account Number and click Search dp.enter_account_number_search(account_number) # increase timeout to 15 time.sleep(15) mdp = MYCL_default_page(driver) # Click User Drop Down / Client Link, Redirect to Client Link Site # Click Menu Hamburger mdp.click_hamburger_menu() time.sleep(20) hm = hamburger_menu(driver) hm.click_client_link() # set to 10 or above time.sleep(30) # Navigate to Account / Positions # Verify text exists in Price Column current_url = driver.current_url slashparts = current_url.split('/') bbu = build_base_url() home_index_string = bbu.return_home_index_string() nav_url = '/'.join(slashparts[:3]) + '/' + home_index_string nav_screen = "account_positions" screen = Screens.return_screens(nav_screen) driver.get(nav_url + screen) # Set timeout to 25 time.sleep(25) pos = positions(driver) pos.verify_Close_Price_Column_Displays(test_case_ID, browser, env, time_stamp) time.sleep(1) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(1) # Logout # Click User Drop Down (on MYCL Default Page) mdp = MYCL_default_page(driver) mdp.click_user_drop_down() time.sleep(2) # Click Logout mudd = MYCL_user_drop_down(driver) mudd.click_logout() time.sleep(3) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(3) driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T267_a' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() # Search for User Account time.sleep(5) # Login to Site lp = LoginPage(driver) gp = generic_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(1) # Enter Account Number and click Search dp.enter_account_number_search(account_number) time.sleep(10) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) # Click Notes Button dp.click_notes_button() time.sleep(15) nm = notes_modal(driver) # click "All Rep Notes" nm.click_all_rep_notes_tab() time.sleep(1) # Click PDF Export Button arnt = all_rep_notes_tab(driver) arnt.click_export_pdf_button() time.sleep(3) # Switch to Rep Notes PDF driver.switch_to.window(driver.window_handles[1]) time.sleep(3) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Close Window driver.close() time.sleep(1) # Switch back to Main Window driver.switch_to.window(driver.window_handles[0]) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(5) # LOGOUT Section # Click User Drop Down (on BICL Default Page) dp.click_user_drop_down() time.sleep(2) # Click Logout udd = user_drop_down(driver) udd.click_logout() # Close Browser driver.quit()
env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() # Search for User Account time.sleep(5) # Login to Site lp = LoginPage(driver) gp = generic_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) time.sleep(1)
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T411' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_MYCL.return_environments(env) driver.get(baseURL) driver.maximize_window() # Search for User Account time.sleep(5) # Login to Site lp = LoginPage(driver) gp = generic_page(driver) lp.login(username, password) lp.click_login_button() time.sleep(30) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) # instantiate dashboard d = dashboard(driver) time.sleep(20) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) # Logout # Click User Drop Down (on MYCL Default Page) mdp = MYCL_default_page(driver) mdp.click_user_drop_down() time.sleep(2) # Click Logout mudd = MYCL_user_drop_down(driver) mudd.click_logout() # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(5) driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T430' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "PROD" baseURL = Environments_MYCL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() time.sleep(5) # Login to Site lp = LoginPage(driver) gp = generic_page(driver) lp.login(username, password) lp.click_login_button() time.sleep(10) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) time.sleep(5) # Navigate to Account \ Cash Flow current_url = driver.current_url slashparts = current_url.split('/') bbu = build_base_url() home_index_string = bbu.return_home_index_string() nav_url = '/'.join(slashparts[:3]) + '/' + home_index_string screen_to_navigate_to_1 = "account_cashflow" screen_1 = Screens.return_screens(screen_to_navigate_to_1) driver.get(nav_url + screen_1) time.sleep(15) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) # Logout # Click User Drop Down (on MYCL Default Page) mdp = MYCL_default_page(driver) mdp.click_user_drop_down() time.sleep(5) # Click Logout mudd = MYCL_user_drop_down(driver) mudd.click_logout() time.sleep(15) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T193' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "DEV" baseURL_Admin = Environments_ADMIN.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" # Launch Admin Site # driver.get(baseURL_Admin) # driver.maximize_window() # Assemble Admin URL String with User Creds parse_object = urlparse(baseURL_Admin) fdqm = parse_object.netloc base_url = "https://" + username + ":" + password + "@" + fdqm # Navigate to Admin Page using Admin URL String driver.get(base_url) driver.maximize_window() # Workaround to Navigate to User Admin Screen current_url = driver.current_url slashparts = current_url.split('/') # Now join back the first three sections 'http:', '' and 'example.com' base_url = '/'.join(slashparts[:3]) + '/' manage_user_string = "ManageUser.aspx" manage_user_screen = base_url + manage_user_string # Navigate to Manage User Screen driver.get(manage_user_screen) time.sleep(5) adm = admin(driver) # search for user account adm.enter_user_account_click_search(username) gp = generic_page(driver) gp.scroll_down() time.sleep(5) adm.click_password_reset_button() # Change focus to Modal time.sleep(1) # switch focus to modal driver.switch_to.window(driver.window_handles[1]) time.sleep(1) prm_before = password_reset_modal_before(driver) # Click Reset Password prm_before.click_reset_password() time.sleep(1) # Parse and Save Password String prm_after = password_reset_modal_after(driver) updated_password = prm_after.return_new_password() # time.sleep(1) # print(updated_password) # time.sleep(1) # Take screenshot after login and save to utilities/test_results/screenshots screenshot_1 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_1" + "_" + control_point_1 + "_" + time_stamp + ".png" saved_screenshot_location_1 = str(screenshot_directory / screenshot_1) driver.get_screenshot_as_file(saved_screenshot_location_1) # Close password reset modal prm_after.click_close() time.sleep(1) # switch focus to parent window driver.switch_to.window(driver.window_handles[0]) time.sleep(1) # Launch BICL Site & login # env = "DEV" baseURL_BICL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" time.sleep(5) driver.get(baseURL_BICL) driver.maximize_window() time.sleep(1) # Login to Site lp = LoginPage(driver) # Verify if page loads (username_field should be clickable), if not, throw exception and take screenshot try: username_field = lp.Page_Elements().driver.find_element_by_id( "UserName") username_field.click() except NoSuchElementException: screenshot_name = "FAIL" + "_" + test_case_ID + "_" + browser + "_" + env + "_" + time_stamp + ".png" saved_screenshot_location = str(screenshot_directory / screenshot_name) driver.get_screenshot_as_file(saved_screenshot_location) raise lp.login(username, updated_password) lp.click_login_button() time.sleep(10) # Set Password back to original cpm = change_password_modal(driver) # input password into required fields cpm.input_new_password(password) # confirm password # cpm.confirm_new_password(password) # Take screenshot after login and save to utilities/test_results/screenshots screenshot_2 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_2" + "_" + control_point_2 + "_" + time_stamp + ".png" saved_screenshot_location_2 = str(screenshot_directory / screenshot_2) driver.get_screenshot_as_file(saved_screenshot_location_2) # Click Submit cpm.click_submit_button() time.sleep(1) # Close "Change Password" Modal cpm.close_change_password_modal() time.sleep(1) dp = default_page(driver) # Timeout method for page to load, timeout set to 30 seconds try: driver.set_page_load_timeout(30) except: screenshot_name = "FAIL" + "_" + test_case_ID + "_" + browser + "_" + env + "_" + time_stamp + ".png" saved_screenshot_location = str(screenshot_directory / screenshot_name) driver.get_screenshot_as_file(saved_screenshot_location) raise time.sleep(5) # LOGOUT Section # Click User Drop Down (on BICL Default Page) dp.click_user_drop_down() time.sleep(2) # Click Logout udd = user_drop_down(driver) udd.click_logout() # Launch BICL Site driver.get(baseURL_BICL) driver.maximize_window() # Login to Site lp = LoginPage(driver) # Take screenshot after login and save to utilities/test_results/screenshots screenshot_3 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_2" + "_" + control_point_3 + "_" + time_stamp + ".png" saved_screenshot_location_3 = str(screenshot_directory / screenshot_3) driver.get_screenshot_as_file(saved_screenshot_location_3) lp.login(username, password) lp.click_login_button() time.sleep(5) dp = default_page(driver) time.sleep(10) # Take screenshot after login and save to utilities/test_results/screenshots screenshot_4 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_4" + "_" + control_point_4 + "_" + time_stamp + ".png" saved_screenshot_location_4 = str(screenshot_directory / screenshot_4) driver.get_screenshot_as_file(saved_screenshot_location_4) # LOGOUT Section # Click User Drop Down (on BICL Default Page) dp.click_user_drop_down() time.sleep(2) # Click Logout udd = user_drop_down(driver) udd.click_logout() # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T323' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_BICL.return_environments(env) # baseURL = "https://beta.bi.dev.wedbus.com" driver.get(baseURL) driver.maximize_window() # Search for User Account time.sleep(5) # Login to Site lp = LoginPage(driver) gp = generic_page(driver) # Timeout method for page to load, timeout set to 30 seconds gp.verify_page_loads(test_case_ID, browser, env, time_stamp) lp.login(username, password) lp.click_login_button() time.sleep(10) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) dp = default_page(driver) time.sleep(5) # Click Account Search Button dp.click_account_search_button() time.sleep(5) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(5) asm = account_search_modal(driver) # input value in NAME field asm.input_value_in_name_field(test_data1) # input value in SSN Field # asm.input_value_in_ssn_field(test_data2) # input value in Rep Code asm.clear_value_in_rep_code_field() # Click GO (Search) Button asm.click_account_search_go_button() # set to 10 - 15 time.sleep(15) asm.locate_click_account() # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(1) # Search for a previously searched for account dp.search_for_previously_searched_for_account() time.sleep(10) # Click GAIN & LOSS Icon dp.click_gain_loss_icon() time.sleep(5) # Enter "TEST" in NAME field of ACCOUNT SEARCH window asm.input_value_in_name_field(test_data2) # Click GO (Search) Button asm.click_account_search_go_button() time.sleep(15) # close account_search_modal asm.close_account_search_modal() time.sleep(5) # Open Account Search Modal, Perform Search with "TEST" in Name field dp.click_account_search_button_after_close() time.sleep(5) # Take Screenshot 4 screenshot_number = "4" time_stamp_4 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_4, screenshot_number, env, time_stamp_4) time.sleep(5) # Confirm that fields blank in Account Search Modal asm.verify_fields_blank_name(test_case_ID, browser, env, time_stamp) time.sleep(5) asm.verify_ssn_field_blank(test_case_ID, browser, env, time_stamp) time.sleep(5) asm.verify_rep_code_field_blank(test_case_ID, browser, env, time_stamp) time.sleep(5) # input TEST in NAME field asm.input_value_in_name_field(test_data2) time.sleep(1) # Click GO (Search) Button asm.click_account_search_go_button() # Set to 15 time.sleep(10) # close account_search_modal asm.close_account_search_modal() # LOGOUT Section # Click User Drop Down (on BICL Default Page) # dp.click_user_drop_down() # # time.sleep(2) # Click Logout # udd = user_drop_down(driver) # udd.click_logout() time.sleep(5) # Force Logout # Logout Workaround # Get current URL string, find base URL # Add logout_string to base_url to force logout current_url = driver.current_url slashparts = current_url.split('/') # Now join back the first three sections 'http:', '' and 'example.com' base_url = '/'.join(slashparts[:3]) + '/' logout_string = "user/login?logout=1" logout_screen = base_url + logout_string # Navigate to Logout Screen driver.get(logout_screen) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T238' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_MYCL.return_environments(env) driver.get(baseURL) driver.maximize_window() gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) time.sleep(1) mdp = MYCL_default_page(driver) # Verify URL contains HTTPS mdp.validate_https_in_url_address(test_data1, test_case_ID, browser, env, time_stamp) time.sleep(10) # Login to Site lp = LoginPage(driver) lp.login(username, password) lp.click_login_button() time.sleep(20) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(10) # LOGOUT Section # Force Logout # Logout Workaround # Get current URL string, find base URL # Add logout_string to base_url to force logout current_url = driver.current_url slashparts = current_url.split('/') # Now join back the first three sections 'http:', '' and 'example.com' base_url = '/'.join(slashparts[:3]) + '/' logout_string = "user/login?logout=1" logout_screen = base_url + logout_string # Navigate to Logout Screen driver.get(logout_screen) # Take Screenshot 3 screenshot_number = "3" time_stamp_3 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_3, screenshot_number, env, time_stamp_3) time.sleep(10) driver.quit()
def test_bICL_ADMIN_TOOL_ROLE_TEMPLATES_Confirm_text_does_not_display( self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T197' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "DEV" baseURL_Admin = Environments_ADMIN.return_environments(env) # Launch Admin Site # driver.get(baseURL_Admin) # driver.maximize_window() # Assemble Admin URL String with User Creds parse_object = urlparse(baseURL_Admin) fdqm = parse_object.netloc base_url = "https://" + username + ":" + password + "@" + fdqm # Navigate to Admin Page using Admin URL String driver.get(base_url) driver.maximize_window() time.sleep(1) # Navigate to Role Templates current_url = driver.current_url slashparts = current_url.split('/') base_url = '/'.join(slashparts[:3]) + '/' time.sleep(1) screen_to_navigate_to_1 = "Role_Templates" screen_1 = Screens.return_screens(screen_to_navigate_to_1) nav_string_1 = base_url + screen_1 driver.get(nav_string_1) time.sleep(10) rt = role_templates(driver) # Select Developer rt.change_role_to_developer() # Scroll Down Page gp = generic_page(driver) gp.scroll_down() # Take screenshot and save to utilities/test_results/screenshots screenshot_1 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_1" + "_" + control_point_1 + "_" + time_stamp + ".png" saved_screenshot_location_1 = str(screenshot_directory / screenshot_1) driver.get_screenshot_as_file(saved_screenshot_location_1) time.sleep(3) # Checkmark "X" and Save rt.checkmark_x_label() rt.click_update_button() time.sleep(1) # Navigate to Admin current_url_2 = driver.current_url slashparts_2 = current_url_2.split('/') base_url_2 = '/'.join(slashparts_2[:3]) + '/' screen_to_navigate_to_2 = "Users" screen_2 = Screens.return_screens(screen_to_navigate_to_2) nav_string_2 = base_url_2 + screen_2 driver.get(nav_string_2) time.sleep(5) # Navigate to Role Templates driver.get(nav_string_1) time.sleep(5) # Select Developer rt.change_role_to_developer() gp.scroll_down() # Verify that checkmark persists rt.verify_x_label_checked(test_case_ID, browser, env, time_stamp) time.sleep(1) # Take screenshot save to utilities/test_results/screenshots screenshot_2 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_2" + "_" + control_point_2 + "_" + time_stamp + ".png" saved_screenshot_location_2 = str(screenshot_directory / screenshot_2) driver.get_screenshot_as_file(saved_screenshot_location_2) time.sleep(5) # Reset Condition # Uncheck Checkmark and Save # Checkmark "X" and Save rt.checkmark_x_label() rt.click_update_button() time.sleep(5) # Take screenshot save to utilities/test_results/screenshots screenshot_3 = test_case_ID + "_" + browser + "_" + env + "_" + "screenshot_3" + "_" + control_point_3 + "_" + time_stamp + ".png" saved_screenshot_location_3 = str(screenshot_directory / screenshot_3) driver.get_screenshot_as_file(saved_screenshot_location_3) # Close Browser driver.quit()
def test_login_chrome(self, browser, env): driver = browser # Create Time Stamp Variable (using Date Time Generator Class in utilities) dg = date_time_generator() time_stamp = dg.return_time_stamp() # This section reads in values from csv file using Pandas Library # Declare Test Case ID test_case_ID = 'QTML-T159' # Declare csv directory df = pd.read_csv(csv_directory) # print(df) # Select Row where "Test_Case_ID" Column Matches the test_case_ID declared above (Line 31) # This is the row that contains the data values for this test scenario test_case_row = df.loc[df.Test_Case_ID == test_case_ID] # print(test_case_row) # Read in Values from "test_case_row" object test_scenario = test_case_row['Test_Scenario'].values[0] username = test_case_row['User'].values[0] password = test_case_row['Password'].values[0] browser = test_case_row['Browser'].values[0] account_number = test_case_row['account_number'].values[0] rep_code = test_case_row['rep_code'].values[0] test_data1 = test_case_row['test_data1'].values[0] test_data2 = test_case_row['test_data_2'].values[0] control_point_1 = test_case_row['control_point_1'].values[0] control_point_2 = test_case_row['control_point_2'].values[0] control_point_3 = test_case_row['control_point_3'].values[0] control_point_4 = test_case_row['control_point_4'].values[0] # To DEBUG, Uncomment this NEXT line AND Comment lines 13, 15 and 18. Also, SHIFT + TAB lines 17 - 86 (This will remove indents) # driver = webdriver.Chrome(str(CONFIG_PATH / 'chromedriver.exe')) ## Select Appropriate URL based on the Environment Value (env) # env = "UAT" baseURL = Environments_MYCL.return_environments(env) driver.get(baseURL) driver.maximize_window() gp = generic_page(driver) # Take Screenshot 1 screenshot_number = "1" time_stamp_1 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_1, screenshot_number, env, time_stamp_1) time.sleep(3) mdp = MYCL_default_page(driver) # Verify URL contains HTTPS mdp.validate_https_in_url_address(test_data1, test_case_ID, browser, env, time_stamp) time.sleep(3) # Take Screenshot 2 screenshot_number = "2" time_stamp_2 = dg.return_time_stamp() gp.take_screenshot(test_case_ID, browser, control_point_2, screenshot_number, env, time_stamp_2) time.sleep(3) # Close Browser driver.quit()