Exemplo n.º 1
0
class LoginPage:
    def __init__(self, driver):
        self.driver = driver
        self.actions = Actions(driver)
        self.touchActions = TouchAction(driver)

    def testLogin(self, login, password):
        self.actions._type(LoginPageLocators._username_input, login)
        self.driver.implicitly_wait(5)
        self.actions._type(LoginPageLocators._password_input, password)
        self.driver.implicitly_wait(5)
        self.actions._click(LoginPageLocators._signin_button)



    def invalidusername(self):
        try:
            self.actions._wait_for_element(LoginPageLocators._wrong_username)
        except:
            print('exception')
            return False
        else:
            print("Login failed!")
            return True

    def invalidpass(self):
        try:
            self.actions._wait_for_element(LoginPageLocators._wrong_pass)
        except:
            print('exception')
            return False
        else:
            print("Incorrect user ID or password!")
            return True
Exemplo n.º 2
0
class LocationPage:
    def __init__(self, driver):
        self.driver = driver
        self.actions = Actions(driver)

    def writelocation(self, city):
        #self.actions._wait_for_element(SwipeLocationLocators._search_box)
        self.actions._type(SwipeLocationLocators._search_box, city)
        self.driver.implicitly_wait(5)

    def chooselocation(self, city_name):
        self.actions._wait_for_element_dynamic(SwipeLocationLocators._line_results, city_name)
        self.actions._click_dynamic(SwipeLocationLocators._line_results, city_name)

    def findfirstline(self):
        self.actions._find(SwipeLocationLocators._line_results)

    def tapfirstline(self):
        self.actions._wait_for_element(SwipeLocationLocators._line_results)
        self.actions._click(SwipeLocationLocators._line_results)