def register_now_link_can_be_opened(self): regnow = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "registernowlnktxt"))) regnow.click() self.attach_screenshot("window opened") self.go_back("Account Registration - Paysera")
def enter_user_credential(self, value): #self.get_xpath("LoginElements", "usernamelogin").send_keys(value) un = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "usernamelogin"))) un.send_keys(value) self.attach_screenshot("data was entered")
def Helpdeskn_link_is_opened(self): helpdesk = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "helpdesk"))) helpdesk.click() self.close_tab( "https://bank.paysera.com/en/login", "https://support.paysera.com/visitor/index.php?/payseraeng/LiveChat/Chat/Request/_sessionID=/_promptType=chat/_proactive=0/_filterDepartmentID=29/_randomNumber=n5i1laz54zo02b1iw72ptb3kh8492b5i/_fullName=/_email=/" )
def appstore_button_is_clicked(self): appstore = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "appstorebtn"))) appstore.click() #self.wait_until_element_is_displayed("//span[contains(text(),'App Store')]") self.close_tab( "https://bank.paysera.com/en/login", "https://apps.apple.com/app/paysera-mobile-wallet/id737308884")
def banner_description_is_displayed(self): bdescription = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "bannerdescription"))) self.assert_correct_text_is_displayed( bdescription, "Check your account balance, perform bank transfers with a few clicks, exchange currency, " "send money requests to friends and try other convenient features with the Paysera Mobile App." )
def googleplay_button_is_clicked(self): googleplay = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "googleplaybtn"))) googleplay.click() #self.wait_until_element_is_displayed("//a[@title='Google Play Logo']") self.close_tab( "https://bank.paysera.com/en/login", "https://play.google.com/store/apps/details?id=lt.lemonlabs.android.paysera" )
def setup(request): browser_name = request.config.getoption("browser_name") if browser_name == "chrome": path = "./Drivers/chromedriver.exe" driver = Chrome(executable_path=path) elif browser_name == "firefox": path1 = "./Drivers/geckodriver.exe" driver = webdriver.Firefox(executable_path=path1) elif browser_name == "edge": path2 = "./Drivers/MicrosoftWebDriver.exe" driver = webdriver.Edge(executable_path=path2) driver.get(ConfigReader.read_config_data("Details", "LoginPage_url")) driver.maximize_window() request.cls.driver = driver driver.implicitly_wait(50) assert driver.title == "Log in to your account - Paysera" yield driver.close()
def click_login_button(self): #self.get_xpath("LoginElements", "loginbutton").click() loginbutton = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "loginbutton"))) loginbutton.click()
def enter_password(self, value): #self.get_xpath("LoginElements", "password").send_keys(value) pw = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "password"))) pw.send_keys(value) self.attach_screenshot("data was entered")
def recommendation_link_is_displayed(self): reco = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "recommend"))) self.assert_element_is_displayed(reco)
def verify_error_is_displayed_invalid_password_input(self): invalidpass = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "error"))) self.assert_correct_text_is_displayed( invalidpass, "Incorrect password. Please try again.") self.attach_screenshot("Error Message is displayed")
def verify_error_is_displayed_invalid_username_input(self): invaliduser = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "error"))) self.assert_correct_text_is_displayed( invaliduser, "The specified user could not be found") self.attach_screenshot("Error Message is displayed")
def service_agreement_link_is_opened(self): serviceagreement = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "serviceagree"))) serviceagreement.click() self.go_back("Paysera")
def privacy_policy_link_is_opened(self): privacypolicy = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "privacy"))) privacypolicy.click() self.go_back("Privacy Policy")
def login_button_is_displayed(self): loginbutton = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "usernamelogin"))) self.assert_element_is_displayed(loginbutton)
def login_panel_is_displayed(self): lpanel = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "loginpanel"))) self.assert_element_is_displayed(lpanel)
def login_banner_is_displayed(self): lbanner = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "lbanner"))) self.assert_correct_text_is_displayed( lbanner, "The Paysera mobile application – for more convenient use")
def logo_is_displayed(self): logo = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "logo"))) self.assert_element_is_displayed(logo)
def sidebar_is_displayed(self): side = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "sidebar"))) self.assert_element_is_displayed(side)
def click_pencil_icon(self): pencilicon = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "pencilicon"))) pencilicon.click()
def service_agreement_link_is_displayed(self): serviceagreement = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "serviceagree"))) self.assert_element_is_displayed(serviceagreement)
def verify_user_can_logout(self): signout = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "logout"))) signout.click()
def recommendation_link_is_opened(self): reco = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "recommend"))) reco.click() self.go_back("Recommendations for the safe use of Paysera")
def user_identifier_textbox_is_displayed(self): usernamelogin = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "usernamelogin"))) self.assert_element_is_displayed(usernamelogin)
def appstore_btn_is_displayed(self): appstore = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "appstorebtn"))) self.assert_element_is_displayed(appstore)
def Register_Now_link_is_displayed(self): regnow = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "registernowlnktxt"))) self.assert_element_is_displayed(regnow)
def googleplay_button_is_displayed(self): googleplay = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("LoginElements", "googleplaybtn"))) self.assert_element_is_displayed(googleplay)
def get_xpath(self, details, xpathvalue): self.driver.find_element_by_xpath( (ConfigReader.read_login_elements(details, xpathvalue)))
def privacy_policy_link_is_displayed(self): privacypolicy = self.driver.find_element_by_xpath( (ConfigReader.read_login_elements("Footer", "privacy"))) self.assert_element_is_displayed(privacypolicy)