def test_TC_Profile_01_Edit_Profile(self): print("<b> Expected Results: Able to edit profile. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Profile(self) print("<li>" + "Edit username: "******"</li>" + "<br>") self.driver.find_element_by_id( UserpageElement.account_username_field).clear() time.sleep(1) self.driver.find_element_by_id( UserpageElement.account_username_field).send_keys( UserData.username) print("<li>" + "Click on Save button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_save_button).click() # Wait till alert is present alert = WebDriverWait(self.driver, 10).until(EC.alert_is_present()) # Switch the control to the Alert window registration_prompt = self.driver.switch_to.alert # Retrieve the message on the Alert window prompt_message = registration_prompt.text print("Alert shows following message: " + prompt_message + "<br>") # Click on the OK button (Accept) print("<li>" + "Click on OK button" + "</li>" + "<br>") registration_prompt.accept() time.sleep(1) # Assert self.assertEqual(prompt_message, "success", "User is not able to edit profile.")
def test_TC_SportM8_04_Quick_Transfer(self): print("<b> Expected Results: Able to perform quick transfer. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Sport(self) ProvidersActions.Access_to_SportM8_Page(self) ProvidersActions.Click_on_SportM8_Game(self) time.sleep(2) ProvidersActions.Quick_Transfer(self)
def test_TC_SportM8_03_Enter_Game(self): print("<b> Expected Results: Able to access to gaming page. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Sport(self) ProvidersActions.Access_to_SportM8_Page(self) ProvidersActions.Click_on_SportM8_Game(self) time.sleep(2) ProvidersActions.Enter_Game(self)
def test_TC_SportM8_02_Navigate_to_M8_Sports_AfterLogin(self): print("<b> Expected Results: Quick Transfer modal dialog is displayed when accessing M8 Sports game with valid login. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Sport(self) ProvidersActions.Access_to_SportM8_Page(self) ProvidersActions.Click_on_SportM8_Game(self) time.sleep(2) ProvidersActions.Assert_Quick_Transfer(self)
def test_TC_CasinoBIG_02_Navigate_to_BIG_AfterLogin(self): print( "<b> Expected Results: Quick Transfer modal dialog is displayed when accessing Big Gaming game with valid login. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) MainpageActions.Access_to_Casino(self) ProvidersActions.Access_to_CasinoBigGaming_Page(self) ProvidersActions.Click_on_CasinoBigGaming_Game(self) time.sleep(2) ProvidersActions.Assert_Quick_Transfer(self)
def test_TC_Login_02_Logout(self): print("<b> Expected Results: Login from the account. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) print("<li>" + "Click on Log Out button" + "</li>" + "<br>") self.driver.find_element_by_class_name( LogInElement.logout_button).click() # Wait page load wait_page_load = EC.presence_of_element_located( (By.XPATH, LogInElement.login_button)) WebDriverWait(self.driver, 10).until(wait_page_load) logout_from_main = self.driver.find_element_by_xpath( LogInElement.login_button).is_displayed() self.assertTrue(logout_from_main, "User is not able to logout from the account.")
def test_TC_Notification_01_View_Notification(self): print("<b> Expected Results: Able to view notification details. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Notification(self) print("<li>" + "Click on a Notification" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.notification_notification).click() time.sleep(1) notification_details = self.driver.find_element_by_class_name( UserpageElement.notification_details).is_displayed() # Assert self.assertTrue(notification_details, "Unable to view the notification details.")
def test_TC_Account_05_View_Withdrawal_Record(self): print("<b> Expected Results: Able to view withdrawal record. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Account(self) print("<li>" + "Click on Record tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_record_tab).click() print("<li>" + "Click on Withdrawal Record tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_rwithdrawal_tab).click() time.sleep(3) # Assert withdrawal_detail = self.driver.find_element_by_xpath( UserpageElement.account_withdrawal_details).text self.assertNotEqual(withdrawal_detail, "", "Report is not available.")
def test_TC_Account_01_Submit_Deposit(self): print("<b> Expected Results: Able to submit deposit. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Account(self) print("<li>" + "Click on Deposit tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_deposit_tab).click() time.sleep(1) print("<li>" + "Select Deposit Bank: Public Bank" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_deposit_bank).click() print("<li>" + "Select Deposit Amount: 50" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_deposit_amount).click() print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_deposit_submit_button).click()
def test_TC_Account_03_Perform_Transfer(self): print("<b> Expected Results: Able to perform transfer. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Account(self) print("<li>" + "Click on Transfer tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_transfer_tab).click() time.sleep(1) print("<li>" + "Select Transfer from: Main Wallet" + "</li>" + "<br>") # Select transfer form select_transfer_from = Select( self.driver.find_element_by_xpath( UserpageElement.account_transfer_from)) # select by visible text select_transfer_from.select_by_visible_text('Main Wallet') print("<li>" + "Select Transfer to: Evolution Gaming" + "</li>" + "<br>") # Select transfer to select_transfer_to = Select( self.driver.find_element_by_xpath( UserpageElement.account_transfer_to)) # select by visible text select_transfer_to.select_by_visible_text('Evolution Gaming') print("<li>" + "Insert Transfer Amount: " + UserData.account_transfer_amount + "</li>" + "<br>") self.driver.find_element_by_id( UserpageElement.account_transfer_amount_field).send_keys( UserData.account_transfer_amount) print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_transfer_submit_button).click() # Wait till alert is present alert = WebDriverWait(self.driver, 10).until(EC.alert_is_present()) # Switch the control to the Alert window registration_prompt = self.driver.switch_to.alert # Retrieve the message on the Alert window prompt_message = registration_prompt.text print("Alert shows following message: " + prompt_message + "<br>") # Click on the OK button (Accept) print("<li>" + "Click on OK button" + "</li>" + "<br>") registration_prompt.accept() time.sleep(1) # Assert self.assertEqual(prompt_message, "success", "User is not able to perform transfer.")
def test_TC_Account_02_Submit_Withdrawal(self): print("<b> Expected Results: Able to submit withdrawal. </b>" + "<br>") LoginpageActions.Login_to_Mainpage(self) UserActions.Access_to_Account(self) print("<li>" + "Click on Withdrawal tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_withdrawal_tab).click() time.sleep(1) print("<li>" + "Select Withdrawal Bank: Maybank : 27****8452" + "</li>" + "<br>") # Select transfer form select_withdrawal_bank = Select( self.driver.find_element_by_xpath( UserpageElement.account_withdrawal_bank)) # select by visible text select_withdrawal_bank.select_by_visible_text('Maybank : 27****8452') print("<li>" + "Insert Withdrawal Amount: " + UserData.withdrawal_withdrawal_amount + "</li>" + "<br>") self.driver.find_element_by_id( UserpageElement.account_withdrawal_amount).send_keys( UserData.withdrawal_withdrawal_amount) print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserpageElement.account_withdrawal_submit_button).click()
def test_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)