def i_type_slowly_keystring_in_driver( self, driver: AppDriver, slowly: bool, keystring: str, ): driver.type(keystring, slowly)
def i_drag_element_and_drop_it_into_container_in_driver( self, driver: AppDriver, element: Selector, container: Selector, ): driver.drag_and_drop(element, container)
def i_long_press_key_in_driver( self, driver: AppDriver, long: Optional[str], key: str, ): driver.press_key(key)
def i_set_selector_value_to_value_in_driver( self, driver: AppDriver, selector: Selector, value: str, ): driver.set_value_by_selector(selector, value)
def selector_should_not_be_displayed_in_driver( self, driver: AppDriver, selector: Selector, is_not: bool): try: if is_not: driver.wait_until_not_visible(selector) else: driver.wait_until_displayed(selector) except TimeoutException as err: raise AssertionError(err, "Selector is still visible", selector)
def i_see_window_identified_by_selector_as_window_name_in_driver( self, driver: AppDriver, selector: Selector, window_name: str, ): handle = driver.wait_until_window_present(selector) self.e2e.variables['windows'][window_name] = handle
def i_remember_a_value_from_attribute_of_selector_in_driver_as_variable( self, driver: AppDriver, attribute: Optional[str], selector: Selector, variable: str, ): element: WebElement = driver.wait_until_present(selector) value = element.get_attribute(attribute) if attribute else element.text self.e2e.variables[variable] = value
def i_close_the_main_window_in_driver( self, driver: AppDriver ): driver.close_window(self.e2e.variables['windows']['main'])
def i_switch_to_window_name_in_driver( self, driver: AppDriver, window_name: str, ): driver.switch_to_window(self.e2e.variables['windows'][window_name])
def _should_see_value_in_selector(driver: AppDriver, selector: Selector, value: str): try: driver.wait_until_value_visible(selector, value) except TimeoutException as err: raise AssertionError(err, "Selector isn't still visible", selector)
def i_wait_while_selector_appears_in_driver( self, driver: AppDriver, selector: Selector, ): driver.wait_until_displayed(selector)
def i_accept_the_alert_box_by_clicking_on_value_in_driver( self, driver: AppDriver, value: Optional[str] ): driver.accept_alert()
def i_scroll_to_the_element_selector_in_driver( self, driver: AppDriver, selector: Selector ): driver.scroll_to(selector)
def i_wait_unless_selector_appears_in_driver( self, driver: AppDriver, selector: Selector, ): driver.wait_until_not_visible(selector)
def i_close_the_window_name_in_driver( self, driver: AppDriver, window_name: str ): driver.close_window(self.e2e.variables['windows'][window_name])
def i_close_all_windows_in_driver( self, driver: AppDriver ): driver.close_all_windows()
def i_dismiss_the_alert_box_by_clicking_on_value_in_driver( self, driver: AppDriver, value: Optional[str] ): driver.dismiss_alert()