def test_TC_Providers_EVO_02_Quick_Transfer_01(self): print("<b> Expected Results: Able to perform quick transfer. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Providers_Page(self) ProvidersActions.Navigate_to_Evolution_Gaming(self) self.driver.implicitly_wait(10) # Assert for i in range(1, 2, 1): for j in range(1, 5, 1): wait_page_load = EC.presence_of_element_located((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li["+str(i)+"]/a/p")) WebDriverWait(self.driver, 10).until(wait_page_load) game_title = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/p").text print("<li>" + "Click on EVO Game in the list: " + game_title + "</li>" + "<br>") wait_page_load = EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img")) WebDriverWait(self.driver, 10).until(wait_page_load) games = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img").click() ProvidersActions.Assert_Quick_Transfer_Modal_Dialog(self) # Find the initial amount ini_amount = self.driver.find_element_by_css_selector(ProvidersElement.credit_amount).text print("Initial Amount: " + str(ini_amount) + "<br>") ProvidersActions.Quick_Transfer(self) # Close Quick transfer Modal Dialog ProvidersActions.Providers_Close_Quick_Transfer_Modal_Dialogs(self) # Refresh self.driver.refresh() wait_page_load = EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img")) WebDriverWait(self.driver, 10).until(wait_page_load) # Find the finial amount final_amount = self.driver.find_element_by_css_selector(ProvidersElement.credit_amount).text print("Final Amount: " + str(final_amount) + "<br>") self.assertTrue(ini_amount > final_amount, "Unable to perform quick transfer")
def test_TC_AllSlotGames_01_Access_to_AllSlotGames_AfterLogin(self): print( "<b> Expected Results: Quick Transfer modal dialog is displayed. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_AllSlotGames_Page(self) # for i in range(1, 2, 1): for j in range(1, 5, 1): wait_page_load = EC.presence_of_element_located( (By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(MainData.loopranallslot) + "]/a/p")) WebDriverWait(self.driver, 10).until(wait_page_load) game_title = self.driver.find_element_by_xpath( "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(MainData.loopranallslot) + "]/a/p").text print("<li>" + "Click on All Live Games in the list: " + game_title + "</li>" + "<br>") wait_page_load = EC.element_to_be_clickable( (By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(MainData.loopranallslot) + "]/a/img")) WebDriverWait(self.driver, 10).until(wait_page_load) games = self.driver.find_element_by_xpath( "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(MainData.loopranallslot) + "]/a/img").click() # Assert AllSlotGamesActions.Assert_Quick_Transfer_Modal_Dialog(self)
def test_TC_Main_11_Navigate_to_GameProviders(self): print( "<b> Expected Results: Navigated to game providers via main page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) print("<li>" + "Scroll the main page to the bottom" + "</li>" + "<br>") scroll_down = self.driver.find_element_by_class_name( MainpageElement.scroll_down) actions = ActionChains(self.driver) actions.move_to_element(scroll_down).perform() self.driver.implicitly_wait(10) print("<li>" + "Click on a Game Provider in the list: " + str(MainData.looprangameproviders) + "</li>" + "<br>") game_provider = self.driver.find_element_by_xpath( "/html/body/div/div/div/div[2]/div[2]/div/div[1]/div/div/div[" + str(MainData.looprangameproviders) + "]/img").click() # Wait the page loads wait_page_load = EC.presence_of_element_located( (By.CLASS_NAME, MainpageElement.games_title)) WebDriverWait(self.driver, 20).until(wait_page_load) # Assert game_page_element = self.driver.find_element_by_class_name( MainpageElement.games_title).is_displayed() self.assertTrue(game_page_element, "User is not able to access to Providers page.")
def TC_Providers_IGS_01_Enter_Game_03(self): print("<b> Expected Results: Able to enter game page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Providers_Page(self) ProvidersActions.Navigate_to_IGS(self) self.driver.implicitly_wait(10) window_before = self.driver.window_handles[0] # Assert for i in range(25, 37, 1): for j in range(1, 5, 1): wait_page_load = EC.presence_of_element_located((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li["+str(i)+"]/a/p")) WebDriverWait(self.driver, 10).until(wait_page_load) game_title = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/p").text print("<li>" + "Click on IGS Game in the list: " + game_title + "</li>" + "<br>") wait_page_load = EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img")) WebDriverWait(self.driver, 10).until(wait_page_load) games = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img").click() ProvidersActions.Assert_Quick_Transfer_Modal_Dialog(self) ProvidersActions.Quick_Transfer_Enter_Game(self) waitnewpage = EC.new_window_is_opened(self.driver.window_handles) WebDriverWait(self.driver, 30).until(waitnewpage) self.driver.switch_to.window(self.driver.window_handles[1]) self.driver.implicitly_wait(10) ProvidersActions.Assert_New_Gaming_Page(self) # Switch back to Provider Page self.driver.switch_to.window(self.driver.window_handles[0]) # Close Quick transfer Modal Dialog ProvidersActions.Providers_Close_Quick_Transfer_Modal_Dialogs(self)
def test_TC_AllSlotGames_01_Navigate_to_RespinMania_Login(self): print("<b> Expected Results: Access to RespinMania Page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) AllSlotGamesActions.Navigate_to_RespinMania(self) # Assert AllSlotGamesActions.Assert_Quick_Transfer_Modal_Dialog(self)
def test_TC_Providers_M8_01_Enter_Game(self): print("<b> Expected Results: Able to enter game page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Providers_Page(self) ProvidersActions.Navigate_to_M8_Sports(self) self.driver.implicitly_wait(10) window_before = self.driver.window_handles[0] # Assert # for i in range(1, 2, 1): for j in range(10): wait_page_load = EC.presence_of_element_located( (By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(ProvidersData.loopranm8) + "]/a/p")) WebDriverWait(self.driver, 10).until(wait_page_load) game_title = self.driver.find_element_by_xpath( "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(ProvidersData.loopranm8) + "]/a/p").text print("<li>" + "Click on M8 Sports Game in the list: " + game_title + "</li>" + "<br>") games = self.driver.find_element_by_xpath( "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(ProvidersData.loopranm8) + "]/a/img").click() ProvidersActions.Assert_Quick_Transfer_Modal_Dialog(self) ProvidersActions.Quick_Transfer_Enter_Game(self) waitnewpage = EC.new_window_is_opened(self.driver.window_handles) WebDriverWait(self.driver, 30).until(waitnewpage) self.driver.switch_to.window(self.driver.window_handles[1]) self.driver.implicitly_wait(10) ProvidersActions.Assert_New_Gaming_Page(self)
def test_TC_Providers_SBO_01_Enter_Game_02(self): print("<b> Expected Results: Able to enter game page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Providers_Page(self) ProvidersActions.Navigate_to_SBO(self) self.driver.implicitly_wait(10) window_before = self.driver.window_handles[0] # Assert for i in range(9, 18, 1): for j in range(1, 5, 1): wait_page_load = EC.presence_of_element_located((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li["+str(i)+"]/a/p")) WebDriverWait(self.driver, 10).until(wait_page_load) game_title = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/p").text print("<li>" + "Click on Evolution Game in the list: " + game_title + "</li>" + "<br>") wait_page_load = EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img")) WebDriverWait(self.driver, 10).until(wait_page_load) games = self.driver.find_element_by_xpath("/html/body/div/div/div/div[2]/div[2]/div/div[2]/ul/li[" + str(i) + "]/a/img").click() ProvidersActions.Assert_Quick_Transfer_Modal_Dialog(self) ProvidersActions.Quick_Transfer_Enter_Game(self) waitnewpage = EC.new_window_is_opened(self.driver.window_handles) WebDriverWait(self.driver, 30).until(waitnewpage) self.driver.switch_to.window(self.driver.window_handles[1]) self.driver.implicitly_wait(10) ProvidersActions.Assert_New_Gaming_Page(self) # Switch back to Provider Page self.driver.switch_to.window(self.driver.window_handles[0]) # Close Quick transfer Modal Dialog wait_page_load = EC.element_to_be_clickable((By.CLASS_NAME, ProvidersElement.quick_transfer_cross_button)) WebDriverWait(self.driver, 10).until(wait_page_load) self.driver.find_element_by_class_name(ProvidersElement.quick_transfer_cross_button).click() wait_page_load = EC.invisibility_of_element_located((By.CLASS_NAME, ProvidersElement.modal_content)) WebDriverWait(self.driver, 10).until(wait_page_load)
def Navigate_to_Sports_Book(self): LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_AllSportGames_Page(self) # Wait the page loads wait_page_load = EC.element_to_be_clickable((By.XPATH, AllSportGamesElement.sports_book)) WebDriverWait(self.driver, 20).until(wait_page_load) print("<li>" + "Click on Sports Book" + "</li>" + "<br>") self.driver.find_element_by_xpath(AllSportGamesElement.sports_book).click()
def test_TC_Promotion_01_Access_to_Promotion_Details(self): print("<b> Expected Results: Access to Promotion Details. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Promotion_Page(self) print("<li>" + "Click on Promotion image to view the details" + "</li>" + "<br>") self.driver.find_element_by_xpath( PromotionElement.promotion_details).click()
def test_TC_Center_Account_01_Edit_Account_Name(self): print("<b> Expected Results: Able to edit account name. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Account(self) wait_acc_form = EC.element_to_be_clickable( (By.ID, AccountElement.name_field)) WebDriverWait(self.driver, 10).until(wait_acc_form) print("<li>" + "Edit Name" + "</li>" + "<br>") self.driver.find_element_by_id(AccountElement.name_field).clear() self.driver.find_element_by_id(AccountElement.name_field).send_keys( AccountData.edit_name) print("<li>" + "Click on Save changes button" + "</li>" + "<br>") self.driver.find_element_by_xpath( AccountElement.save_changes_button).click() # Wait for success alert # Switch the control to the Alert window alert = WebDriverWait(self.driver, 10).until(EC.alert_is_present()) submit_prompt = self.driver.switch_to.alert # Retrieve the message on the Alert window prompt_message = submit_prompt.text print("Alert shows following message: " + prompt_message + "<br>") # Click on the OK button (Accept) print("<li>" + "Click on OK button" + "</li>" + "<br>") submit_prompt.accept() print("<li>" + "Refresh the page" + "</li>" + "<br>") self.driver.refresh() edited_name = self.driver.find_element_by_id( AccountElement.name_field).text print(edited_name + "<br>") self.assertEqual(prompt_message, "success", "User is not able to edit name.") # Change back the name to ori name print("<li>" + "Edit Name Back to Wendy8888" + "</li>" + "<br>") self.driver.find_element_by_id(AccountElement.name_field).clear() self.driver.find_element_by_id(AccountElement.name_field).send_keys( AccountData.ori_name) print("<li>" + "Click on Save changes button" + "</li>" + "<br>") self.driver.find_element_by_xpath( AccountElement.save_changes_button).click() # Wait for success alert # Switch the control to the Alert window alert = WebDriverWait(self.driver, 10).until(EC.alert_is_present()) submit_prompt = self.driver.switch_to.alert # Retrieve the message on the Alert window prompt_message = submit_prompt.text print("Alert shows following message: " + prompt_message + "<br>") # Click on the OK button (Accept) print("<li>" + "Click on OK button" + "</li>" + "<br>") submit_prompt.accept() print("<li>" + "Refresh the page" + "</li>" + "<br>") self.driver.refresh() ori_name = self.driver.find_element_by_id( AccountElement.name_field).text print(ori_name + "<br>") self.assertEqual(prompt_message, "success", "User is not able to edit back name.")
def Navigate_to_3CardBragLive(self): LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_AllLiveGames_Page(self) # Wait the page loads wait_page_load = EC.element_to_be_clickable( (By.XPATH, AllLiveGamesElement.threecardbraglive)) WebDriverWait(self.driver, 20).until(wait_page_load) print("<li>" + "Click on 3 Card Brag Live" + "</li>" + "<br>") self.driver.find_element_by_xpath( AllLiveGamesElement.threecardbraglive).click()
def TC_Center_Funds_01_Deposit_Amount(self): print( "<b> Expected Results: Able to make deposit to the account. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Funds(self) print("<li>" + "Click on Deposit button" + "</li>" + "<br>") self.driver.find_element_by_class_name( FundsElement.deposit_button).click() wait_page_load = EC.presence_of_element_located( (By.CSS_SELECTOR, FundsElement.deposit_page_title)) WebDriverWait(self.driver, 20).until(wait_page_load) deposit_page = self.driver.find_element_by_css_selector( FundsElement.deposit_page_title).text self.assertEqual(deposit_page, "Deposit", "Not able to access Deposit Page") self.driver.implicitly_wait(10) print("<li>" + "Click on Enter Amount Dropdown" + "</li>" + "<br>") wait_dropdown_enteramount = EC.presence_of_element_located( (By.CLASS_NAME, FundsElement.deposit_form)) WebDriverWait(self.driver, 20).until(wait_dropdown_enteramount) # wait_clickable_enteramount = EC.element_to_be_clickable((By.ID, FundsElement.enter_amount_dropdown)) # WebDriverWait(self.driver, 20).until(wait_clickable_enteramount) self.driver.find_element_by_xpath( FundsElement.enter_amount_dropdown).click() print("<li>" + "Insert amount: " + FundsData.deposit_amount + "</li>" + "<br>") self.driver.find_element_by_id( FundsElement.deposit_amount_field).send_keys( FundsData.deposit_amount) print("<li>" + "Click on Payment Overview Dropdown" + "</li>" + "<br>") self.driver.find_element_by_xpath( FundsElement.payment_overview_dropdown).click() scroll_down = self.driver.find_element_by_xpath( FundsElement.deposit_confirm_button) actions = ActionChains(self.driver) actions.move_to_element(scroll_down).perform() self.driver.implicitly_wait(10) wait_dropdown_paymentoverview = EC.presence_of_element_located( (By.XPATH, FundsElement.deposit_confirm_button)) WebDriverWait(self.driver, 20).until(wait_dropdown_paymentoverview) # will_be_charged_amount = self.driver.find_element_by_css_selector(FundsElement.will_be_charged_amount).text # print(will_be_charged_amount) # self.assertEqual(will_be_charged_amount, FundsData.deposit_amount, "Unable to insert Deposit Amount") print("<li>" + "Click on Confirm button" + "</li>" + "<br>") self.driver.find_element_by_xpath( FundsElement.deposit_confirm_button).click() wait_submit_modal_dialog = EC.element_to_be_clickable( (By.CSS_SELECTOR, FundsElement.bank_details_confirm_button)) WebDriverWait(self.driver, 10).until(wait_submit_modal_dialog) bank_details_modal_dialog = self.driver.find_element_by_css_selector( FundsElement.bank_details_confirm_button).is_displayed() self.assertTrue(bank_details_modal_dialog, "Unable to perform deposit.")
def test_TC_Center_Notification_01_View_Membership_Information(self): print("<b> Expected Results: Able to view notification details. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Notification(self) wait_page_load = EC.presence_of_element_located((By.XPATH, NotificationElement.notification)) WebDriverWait(self.driver, 20).until(wait_page_load) notification_show = self.driver.find_element_by_xpath(NotificationElement.notification).is_displayed() self.assertTrue(notification_show, "Notification is not shown in Notification Page") print("<li>" + "Click on Notification in the list" + "</li>" + "<br>") self.driver.find_element_by_xpath(NotificationElement.notification).click() wait_noti_details = EC.presence_of_element_located((By.CLASS_NAME, NotificationElement.notification_detail)) WebDriverWait(self.driver, 20).until(wait_noti_details) notification_details_show = self.driver.find_element_by_class_name(NotificationElement.notification_detail).is_displayed() self.assertTrue(notification_details_show, "User is not able to view the notification details.")
def test_TC_Center_Referrer_03_View_Bet_Record(self): print("<b> Expected Results: Able to Bet Record. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Referrer(self) wait_page_load = EC.presence_of_element_located((By.XPATH, ReferrerElement.memberlist_tab)) WebDriverWait(self.driver, 20).until(wait_page_load) show_memberlisttab = self.driver.find_element_by_xpath(ReferrerElement.memberlist_tab).is_displayed() self.assertTrue(show_memberlisttab, "Not able to access to Referrer Page.") print("<li>" + "Click on Bet Record" + "</li>" + "<br>") self.driver.find_element_by_xpath(ReferrerElement.bet_record_tab).click() wait_bet_record = EC.presence_of_element_located((By.CLASS_NAME, ReferrerElement.bet_record_filter)) WebDriverWait(self.driver, 20).until(wait_bet_record) # Assert show_bet_record = self.driver.find_element_by_class_name(ReferrerElement.bet_record_filter).is_displayed() self.assertTrue(show_bet_record, "Not able to access to Bet Record.")
def test_TC_Center_Referrer_02_View_Report(self): print("<b> Expected Results: Able to view report. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Referrer(self) wait_page_load = EC.presence_of_element_located((By.XPATH, ReferrerElement.memberlist_tab)) WebDriverWait(self.driver, 20).until(wait_page_load) show_memberlisttab = self.driver.find_element_by_xpath(ReferrerElement.memberlist_tab).is_displayed() self.assertTrue(show_memberlisttab, "Not able to access to Referrer Page.") print("<li>" + "Click on Report" + "</li>" + "<br>") self.driver.find_element_by_xpath(ReferrerElement.report_tab).click() wait_deposit_report = EC.presence_of_element_located((By.CLASS_NAME, ReferrerElement.report_deposit)) WebDriverWait(self.driver, 20).until(wait_deposit_report) # Assert show_deposit_report = self.driver.find_element_by_class_name(ReferrerElement.report_deposit).is_displayed() self.assertTrue(show_deposit_report, "Not able to access to Report.")
def TC_Main_09_View_Notification(self): print( "<b> Expected Results: Navigated to Notification Page by clicking on notification icon. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) self.driver.find_element_by_class_name( MainpageElement.notification_icon).click() # Wait poge loads wait_login_page = EC.text_to_be_present_in_element( (By.CLASS_NAME, MainpageElement.notification_page_title), "Notifications") WebDriverWait(self.driver, 20).until(wait_login_page) notification_title = self.driver.find_element_by_class_name( MainpageElement.notification_page_title).text self.assertEqual( notification_title, "Notifications", "User is not able to navigate to Notification page by clicking on Notification icon." )
def test_TC_Center_Referrer_01_View_Membership_Information(self): print("<b> Expected Results: Able to view membership information. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Referrer(self) wait_page_load = EC.presence_of_element_located((By.XPATH, ReferrerElement.memberlist_tab)) WebDriverWait(self.driver, 20).until(wait_page_load) show_memberlisttab = self.driver.find_element_by_xpath(ReferrerElement.memberlist_tab).is_displayed() self.assertTrue(show_memberlisttab, "Not able to access to Referrer Page.") print("<li>" + "Click on Member List" + "</li>" + "<br>") self.driver.find_element_by_xpath(ReferrerElement.memberlist_tab).click() print("<li>" + "Click on User ID" + "</li>" + "<br>") self.driver.find_element_by_xpath(ReferrerElement.user_id_link).click() # Wait wait_membership_info = EC.element_to_be_clickable((By.CLASS_NAME, ReferrerElement.user_id_exit)) WebDriverWait(self.driver, 20).until(wait_membership_info) # Assert show_memberinfo = self.driver.find_element_by_class_name(ReferrerElement.user_id_exit).is_displayed() self.assertTrue(show_memberinfo, "Not able to access to Membership Information.")
def test_TC_Main_10_View_Deposit(self): print( "<b> Expected Results: Navigated to Deposit Page by clicking on Deposit button. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) print("<li>" + "Click on Deposit button" + "</li>" + "<br>") self.driver.find_element_by_class_name( MainpageElement.deposit_button_at_main).click() # Wait poge loads wait_login_page = EC.text_to_be_present_in_element( (By.CSS_SELECTOR, MainpageElement.deposit_page_title), "Deposit") WebDriverWait(self.driver, 20).until(wait_login_page) deposit_button = self.driver.find_element_by_css_selector( MainpageElement.deposit_page_title).text self.assertEqual( deposit_button, "Deposit", "User is not able to navigate to Deposit page by clicking on Deposit button." )
def test_TC_Login_02_Logout(self): print("<b> Expected Results: Login from the account. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) self.driver.implicitly_wait(10) scroll_down = self.driver.find_element_by_xpath( MainpageElement.logout_button) actions = ActionChains(self.driver) actions.move_to_element(scroll_down).perform() self.driver.implicitly_wait(10) print("<li>" + "Click on Log Out button" + "</li>" + "<br>") self.driver.find_element_by_xpath( MainpageElement.logout_button).click() wait_page_load = EC.presence_of_element_located( (By.CLASS_NAME, MainpageElement.sign_up_button)) WebDriverWait(self.driver, 20).until(wait_page_load) logout_from_main = self.driver.find_element_by_class_name( MainpageElement.sign_up_button).is_displayed() self.assertTrue(logout_from_main, "User is not able to logout from the account.")
def TC_Center_Funds_03_Withdraw_Amount(self): print( "<b> Expected Results: Able to perform withdrawal from the account. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Funds(self) print("<li>" + "Click on Withdraw button" + "</li>" + "<br>") self.driver.find_element_by_class_name( FundsElement.withdraw_button).click() wait_page_load = EC.presence_of_element_located( (By.CSS_SELECTOR, FundsElement.withdraw_page_title)) WebDriverWait(self.driver, 20).until(wait_page_load) withdraw_page = self.driver.find_element_by_css_selector( FundsElement.withdraw_page_title).text self.assertEqual(withdraw_page, "Withdraw", "Not able to access Withdraw Page") print("<li>" + "Click on Withdraw button" + "</li>" + "<br>") self.driver.find_element_by_id( FundsElement.withdraw_amount_field).send_keys( FundsData.withdraw_amount) self.driver.implicitly_wait(10) print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_class_name( FundsElement.withdraw_submit_button).click()
def test_TC_Center_Funds_05_Platform_Transfer(self): print("<b> Expected Results: Able to make platform transfer. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Center_Funds(self) print("<li>" + "Click on Transfer button" + "</li>" + "<br>") self.driver.find_element_by_class_name( FundsElement.transfer_button).click() wait_page_load = EC.presence_of_element_located( (By.XPATH, FundsElement.transfer_page_title)) WebDriverWait(self.driver, 20).until(wait_page_load) withdraw_page = self.driver.find_element_by_xpath( FundsElement.transfer_page_title).text self.assertEqual(withdraw_page, "PLATFORM TRANSFER", "Not able to access Transfer Page") print("<li>" + "Select 'From': " + "Main Wallet" + "</li>" + "<br>") wait_form_load = EC.element_to_be_clickable( (By.XPATH, FundsElement.transfer_from_field)) WebDriverWait(self.driver, 20).until(wait_form_load) self.driver.find_element_by_xpath( FundsElement.transfer_from_field).click() select_main_wallet = Select( self.driver.find_element_by_xpath( FundsElement.transfer_from_field)) select_main_wallet.select_by_value("ZHU") print("<li>" + "Select 'To': " + "Evolution Gaming" + "</li>" + "<br>") select_main_wallet = Select( self.driver.find_element_by_xpath(FundsElement.transfer_to_field)) select_main_wallet.select_by_value("EVO") print("<li>" + "Insert Amount: " + FundsData.transfer_amount + "</li>" + "<br>") self.driver.find_element_by_id( FundsElement.transfer_amount_field).send_keys( FundsData.transfer_amount) wait_ini_amount = EC.text_to_be_present_in_element( (By.CSS_SELECTOR, FundsElement.evo_amount), "RM 0.00") WebDriverWait(self.driver, 20).until_not(wait_ini_amount) ini_main_wallet = self.driver.find_element_by_css_selector( FundsElement.main_wallet_amount).text ini_evo = self.driver.find_element_by_css_selector( FundsElement.evo_amount).text print(ini_main_wallet + "<br>") print(ini_evo + "<br>") # Assert print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_class_name( FundsElement.submit_button).click() # Switch the control to the Alert window alert = WebDriverWait(self.driver, 10).until(EC.alert_is_present()) submit_prompt = self.driver.switch_to.alert # Retrieve the message on the Alert window prompt_message = submit_prompt.text print("Alert shows following message: " + prompt_message + "<br>") # Click on the OK button (Accept) print("<li>" + "Click on OK button" + "</li>" + "<br>") submit_prompt.accept() print("<li>" + "Refresh the page" + "</li>" + "<br>") self.driver.refresh() self.driver.implicitly_wait(10) wait_ini_amount = EC.text_to_be_present_in_element( (By.CSS_SELECTOR, FundsElement.evo_amount), "RM 0.00") WebDriverWait(self.driver, 20).until_not(wait_ini_amount) final_main_wallet = self.driver.find_element_by_css_selector( FundsElement.main_wallet_amount).text final_evo = self.driver.find_element_by_css_selector( FundsElement.evo_amount).text print(final_main_wallet + "<br>") print(final_evo + "<br>") # Assert self.assertTrue(ini_main_wallet < final_main_wallet, "Unable to perform platform transfer.") self.assertTrue(final_evo > ini_evo, "Unable to perform platform transfer.")
def TC_Login_01_Valid_Login(self): print( "<b> Expected Results: Login to Main Page with valid username and password. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self)