def test_TC_Providers_EVO_03_Enter_Game_BeforeLogin(self): print("<b> Expected Results: Navigated to Login Page. </b>" + "<br>") MainpageActions.Access_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, 7, 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(ProvidersData.loopranevo) + "]/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.loopranevo) + "]/a/p").text print("<li>" + "Click on Evolution Gaming 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(ProvidersData.loopranevo) + "]/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(ProvidersData.loopranevo) + "]/a/img").click() # Assert ProvidersActions.Assert_Navigated_to_LoginPage(self)
def Login_to_Mainpage(self): MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_Login_Page(self) # Login with registered username and password print("<li>" + "Insert Username: "******"</li>" + "<br>") self.driver.find_element_by_id(LogInElement.username_field).send_keys( LoginData.username) print("<li>" + "Insert Password: "******"</li>" + "<br>") self.driver.find_element_by_id(LogInElement.password_field).send_keys( LoginData.password) print("<li>" + "Click on Log in button" + "</li>" + "<br>") self.driver.find_element_by_class_name( LogInElement.login_button).click() # Wait the page loads wait_main_page = EC.element_to_be_clickable( (By.CLASS_NAME, MainpageElement.announcement_modal_dialog_close_button)) WebDriverWait(self.driver, 20).until(wait_main_page) # Close Announcement dialog box print("<li>" + "Close the Announcement modal dialog" + "</li>" + "<br>") self.driver.find_element_by_class_name( MainpageElement.announcement_modal_dialog_close_button).click()
def test_TC_AllSlotGames_02_Access_to_AllSlotGames_BeforeLogin(self): print( "<b> Expected Results: Navigated to Login Page after clicking on All Slot Games without valid login. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_AllSlotGames_Page(self) # 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(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() MainpageActions.Assert_Navigated_to_LoginPage(self)
def test_TC_SignUp_01_Sign_Up_New_User(self): print( "<b> Expected Results: Able to login with registered username and password. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_SignUp_Page(self) print("<li>" + "Insert Username: "******"</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.username_field).send_keys( SignUpData.new_username) print("<li>" + "Insert Mobile Phone: " + SignUpData.phone_number + "</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.mobile_phone_field).send_keys( SignUpData.phone_number) print("<li>" + "Insert Email: " + SignUpData.email + "</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.email_field).send_keys(SignUpData.email) print("<li>" + "Insert Password: "******"</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.password_field).send_keys(SignUpData.password) print("<li>" + "Insert Confirm Password: "******"</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.confirm_password_field).send_keys( SignUpData.confirm_password) print("<li>" + "Insert Invitation Code: " + SignUpData.invitation_code + "</li>" + "<br>") self.driver.find_element_by_id( SignUppageElement.invitation_code_field).send_keys( SignUpData.invitation_code) print("<li>" + "Click on Create Account button" + "</li>" + "<br>") self.driver.find_element_by_class_name( SignUppageElement.create_account_button).click() # Wait till alert is present alert = WebDriverWait(self.driver, 20).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() # Assert Navigate to Login Page wait_login_page = EC.presence_of_element_located( (By.CLASS_NAME, LogInElement.login_button)) WebDriverWait(self.driver, 20).until(wait_login_page) # Login with registered username and password print("<li>" + "Insert Username: "******"</li>" + "<br>") self.driver.find_element_by_id(LogInElement.username_field).send_keys( SignUpData.new_username) print("<li>" + "Insert Password: "******"</li>" + "<br>") self.driver.find_element_by_id(LogInElement.password_field).send_keys( SignUpData.password) print("<li>" + "Click on Log in button" + "</li>" + "<br>") self.driver.find_element_by_class_name( LogInElement.login_button).click() # Wait the page loads wait_main_page = EC.element_to_be_clickable( (By.CLASS_NAME, MainpageElement.announcement_modal_dialog_close_button)) WebDriverWait(self.driver, 20).until(wait_main_page) # Close Announcement dialog box print("<li>" + "Close the Announcement modal dialog" + "</li>" + "<br>") self.driver.find_element_by_class_name( MainpageElement.announcement_modal_dialog_close_button).click() # Assert deposit_button = self.driver.find_element_by_class_name( MainpageElement.deposit_button).is_displayed() self.assertTrue( deposit_button, "User is not able to login to main page with registered username and password." )
def test_TC_AllSlotGames_02_Navigate_to_RespinMania_UnLogin(self): print("<b> Expected Results: Access to Login Page. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) AllSlotGamesActions.Navigate_to_JinFuXingYun(self) AllSlotGamesActions.Navigate_back_to_LoginPage(self)
def TC_Main_08_Navigate_to_Providers_Page(self): print("<b> Expected Results: Navigated to Providers page. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_Providers_Page(self)
def TC_Main_06_Navigate_to_All_Sport_Games_Page(self): print("<b> Expected Results: Navigated to All Sport Games page. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_AllSportGames_Page(self)
def TC_Main_03_Navigate_to_SignUp_Page(self): print("<b> Expected Results: Navigated to sign up page. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_SignUp_Page(self)
def TC_Main_02_Navigate_to_Login_Page(self): print("<b> Expected Results: Navigated to login page. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self) MainpageActions.Access_to_Login_Page(self)
def TC_Main_01_Navigate_to_Main_Page(self): print( "<b> Expected Results: Able to access to main page without breaking. </b>" + "<br>") MainpageActions.Access_to_Mainpage(self)