def test_TC_BettingRecord_02_Choose_Game_Platform(self): print("<b> Expected Results: Able to choose game platform. </b>" + "<br>") UserpageActions.Access_to_Betting_Record(self) print("<li>" + "Click on Choose a Game Platform button" + "</li>" + "<br>") self.driver.find_element_by_class_name(UserElement.betting_record_choose_game_platform).click() print("<li>" + "Select a platform: Video All" + "</li>" + "<br>") self.driver.find_element_by_xpath(UserElement.betting_record_game_platform_video_all).click()
def test_TC_PersonalInformation_03_Change_Password(self): print("<b> Expected Results: Able to change password. </b>" + "<br>") UserpageActions.Access_to_Personal_Information(self) print("<li>" + "Click on Change Password button" + "</li>" + "<br>") self.driver.find_element_by_class_name( UserElement.personal_info_change_password).click() print("<li>" + "Insert old password: "******"</li>" + "<br>") self.driver.find_element_by_id( UserElement.personal_info_old_password).send_keys( UserData.old_password) print("<li>" + "Insert new password: "******"</li>" + "<br>") self.driver.find_element_by_id( UserElement.personal_info_new_password).send_keys( UserData.new_password) print("<li>" + "Insert confirm password: "******"</li>" + "<br>") self.driver.find_element_by_id( UserElement.personal_info_confirm_password).send_keys( UserData.confirm_password) print("<li>" + "Click on Next Step button" + "</li>" + "<br>") self.driver.find_element_by_class_name( UserElement.personal_info_next_step).click() # Assert wait_password_modified = EC.presence_of_element_located( (By.XPATH, UserElement.personal_info_password_modified)) WebDriverWait(self.driver, 10).until(wait_password_modified) password_modified = self.driver.find_element_by_xpath( UserElement.personal_info_password_modified).is_displayed() self.assertTrue(password_modified, "Password is not modified successfully.")
def test_TC_FundingRecords_02_View_DepositRecord(self): print("<b> Expected Results: Able to view deposit record. </b>" + "<br>") UserpageActions.Access_to_Funding_Records(self) print("<li>" + "Click on Deposit Record tab" + "</li>" + "<br>") self.driver.find_element_by_xpath(UserElement.funding_record_deposit_record).click() time.sleep(3) # Assert deposit_record = self.driver.find_element_by_xpath(UserElement.funding_record_deposit_details).text self.assertNotEqual(deposit_record, "", "Deposit Record is not available.")
def test_TC_WithdrawalArea_02_Withdraw_Balance(self): print("<b> Expected Results: Able to perform Withdrawal. </b>" + "<br>") UserpageActions.Access_to_Withdrawal_Area(self) print("<li>" + "Select Bank: Maybank" + "</li>" + "<br>") self.driver.find_element_by_xpath(UserElement.withdrawal_area_select_bank).click() print("<li>" + "Insert Withdrawal Amount: " + UserData.withdrawal_area_withdrawal_amount + "</li>" + "<br>") self.driver.find_element_by_id(UserElement.withdrawal_area_amount_field).send_keys(UserData.withdrawal_area_withdrawal_amount) print("<li>" + "Click on Next Step button" + "</li>" + "<br>") self.driver.find_element_by_class_name(UserElement.withdrawal_area_next_step).click()
def test_TC_Announcement_01_Navigate_to_AnnouncementPage(self): print("<b> Expected Results: Able to view announcement page. </b>" + "<br>") UserpageActions.Access_to_Announcement(self) time.sleep(3) # Assert announcement_detail = self.driver.find_element_by_xpath( UserElement.announcement_details).text self.assertNotEqual(announcement_detail, "", "Announcement is not available.")
def test_TC_MemberAgent_03_View_DetailReport(self): print("<b> Expected Results: Able to view detail report. </b>" + "<br>") UserpageActions.Access_to_Member_Agent(self) print("<li>" + "Click on Detail Report tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.member_agent_detail_report).click() time.sleep(3) # Assert detail_report = self.driver.find_element_by_xpath( UserElement.member_agent_detail_report_element).is_displayed() self.assertTrue(detail_report, "Detail Report is not available.")
def test_TC_MemberAgent_04_View_BettingRecord(self): print("<b> Expected Results: Able to view betting record. </b>" + "<br>") UserpageActions.Access_to_Member_Agent(self) print("<li>" + "Click on Betting Record tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.member_agent_betting_record).click() time.sleep(3) # Assert betting_record = self.driver.find_element_by_xpath( UserElement.member_agent_betting_record_element).text self.assertNotEqual(betting_record, "", "Betting Record is not available.")
def test_TC_MemberAgent_02_View_MemberDetails(self): print("<b> Expected Results: Able to view member details. </b>" + "<br>") UserpageActions.Access_to_Member_Agent(self) print("<li>" + "Click on Member Details tab" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.member_agent_member_detail).click() time.sleep(3) # Assert member_detail = self.driver.find_element_by_xpath( UserElement.member_agent_member_detail_element).text self.assertNotEqual(member_detail, "", "Member detail is not available.")
def test_TC_WithdrawalArea_03_Add_Bank(self): print("<b> Expected Results: Able to add bank. </b>" + "<br>") UserpageActions.Access_to_Withdrawal_Area(self) time.sleep(2) print("<li>" + "Click on Add Bank button" + "</li>" + "<br>") self.driver.find_element_by_xpath(UserElement.withdrawal_area_add_bank).click() print("<li>" + "Insert Account Name: " + UserData.acc_name + "</li>" + "<br>") self.driver.find_element_by_id(UserElement.withdrawal_area_account_name_field).send_keys(UserData.acc_name) print("<li>" + "Insert Account Number: " + UserData.acc_number + "</li>" + "<br>") self.driver.find_element_by_id(UserElement.withdrawal_area_acc_number_field).send_keys(UserData.acc_number) print("<li>" + "Select Bank: Public Bank" + "</li>" + "<br>") select_bank = Select(self.driver.find_element_by_id(UserElement.withdrawal_area_select_bank_drop_down)) # select by visible text select_bank.select_by_visible_text('Public Bank') print("<li>" + "Click on Submit button" + "</li>" + "<br>") self.driver.find_element_by_class_name(UserElement.withdrawal_area_submit_button).click()
def TC_QuotaConversion_03_Access_to_Deposit_Page(self): print( "<b> Expected Results: Able to access to Deposit page from Announcement. </b>" + "<br>") UserpageActions.Access_to_Quota_Conversion(self) print("<li>" + "Click on Deposit button" + "</li>" + "<br>") self.driver.find_element_by_class_name( UserElement.quotaconversion_deposit_button).click() # Wait page load wait_page_load = EC.presence_of_element_located( (By.XPATH, UserElement.deposit_area_element)) WebDriverWait(self.driver, 10).until(wait_page_load) page_loaded = self.driver.find_element_by_xpath( UserElement.deposit_area_element).is_displayed() self.assertTrue( page_loaded, "User is not able to access to Withdrawal Page from Announcement.")
def test_TC_DepositArea_02_Bank_Transfer(self): print("<b> Expected Results: Able to perform bank transfer. </b>" + "<br>") UserpageActions.Access_to_Deposit_Area(self) print("<li>" + "Select deposit method: Public Bank" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.deposit_area_deposit_method).click() print("<li>" + "Select deposit amount: 30" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.deposit_area_deposit_amount).click() print("<li>" + "Click on Next Step button" + "</li>" + "<br>") self.driver.find_element_by_class_name( UserElement.deposit_area_next_step_button).click() print("<li>" + "Click on Complete the Deposit, the Next Step button" + "</li>" + "<br>") self.driver.find_element_by_class_name( UserElement.deposit_area_complete_deposit_button).click()
def test_TC_QuotaConversion_04_Perform_Transfer(self): print("<b> Expected Results: Able to perform transfer. </b>" + "<br>") UserpageActions.Access_to_Quota_Conversion(self) time.sleep(5) # Find initial amount ini_accamount = self.driver.find_element_by_xpath( UserElement.quotaconversion_accamount).text ini_evoamount = self.driver.find_element_by_xpath( UserElement.quotaconversion_evoamount).text print("Initial Acc Amount: " + str(ini_accamount) + "<br>") print("Initial Evo Amount: " + str(ini_evoamount) + "<br>") print("<li>" + "Insert transfer amount: " + str(UserData.announcement_transfer_amount) + "</li>" + "<br>") self.driver.find_element_by_id( UserElement.quotaconversion_amount_field).send_keys( UserData.announcement_transfer_amount) time.sleep(1) print("<li>" + "Click on Confirm Transfer button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.quotaconversion_confirm_transfer_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>") # self.assertNotEqual(prompt_message, "Error", "Errors occured.") # Assert time.sleep(5) # Find final amount final_accamount = self.driver.find_element_by_xpath( UserElement.quotaconversion_accamount).text final_evoamount = self.driver.find_element_by_xpath( UserElement.quotaconversion_evoamount).text print("Final Acc Amount: " + str(final_accamount) + "<br>") print("Final Evo Amount: " + str(final_evoamount) + "<br>") self.assertTrue(final_evoamount > ini_evoamount, "Unable to perform transfer.") self.assertTrue(final_accamount < ini_accamount, "Unable to perform transfer.")
def test_TC_PersonalInformation_02_Modify_Personal_Information(self): print( "<b> Expected Results: Able to modify personal information. </b>" + "<br>") UserpageActions.Access_to_Personal_Information(self) print("<li>" + "Click on Modify button" + "</li>" + "<br>") self.driver.find_element_by_xpath( UserElement.personal_info_modify).click() print("<li>" + "Modify Actual Name Field: " + UserData.actual_name + "</li>" + "<br>") self.driver.find_element_by_id( UserElement.personal_info_actual_name).clear() time.sleep(1) print("<li>" + "Click on Confirm button" + "</li>" + "<br>") self.driver.find_element_by_id( UserElement.personal_info_actual_name).send_keys( UserData.actual_name) # Assert wait_button_clickable = EC.element_to_be_clickable( (By.CLASS_NAME, UserElement.personal_info_confirm_button)) WebDriverWait(self.driver, 10).until(wait_button_clickable) self.driver.find_element_by_class_name( UserElement.personal_info_confirm_button).click()
def test_TC_FundingRecords_01_Navigate_to_FundingRecordsPage(self): print("<b> Expected Results: Able to access to funding records page. </b>" + "<br>") UserpageActions.Access_to_Funding_Records(self)
def test_TC_PersonalInformation_01_Navigate_to_PersonalInformationPage( self): print( "<b> Expected Results: Able to access to personal information page. </b>" + "<br>") UserpageActions.Access_to_Personal_Information(self)
def test_TC_BettingRecord_01_Navigate_to_Betting_Record_Page(self): print("<b> Expected Results: Able to access to betting record page. </b>" + "<br>") UserpageActions.Access_to_Betting_Record(self)
def TC_QuotaConversion_01_Navigate_to_AnnouncementPage(self): print( "<b> Expected Results: Able to access to announcement page. </b>" + "<br>") UserpageActions.Access_to_Quota_Conversion(self)
def test_TC_MemberAgent_01_Navigate_to_MemberAgentPage(self): print( "<b> Expected Results: Able to access to member agent page. </b>" + "<br>") UserpageActions.Access_to_Member_Agent(self)
def test_TC_WithdrawalArea_01_Navigate_to_WithdrawalAreaPage(self): print("<b> Expected Results: Able to access to withdrawal area page. </b>" + "<br>") UserpageActions.Access_to_Withdrawal_Area(self)
def test_TC_DepositArea_01_Navigate_to_DepositAreaPage(self): print( "<b> Expected Results: Able to access to deposit area page. </b>" + "<br>") UserpageActions.Access_to_Deposit_Area(self)