Example #1
0
 def i_type_slowly_keystring_in_driver(
         self,
         driver: AppDriver,
         slowly: bool,
         keystring: str,
 ):
     driver.type(keystring, slowly)
Example #2
0
 def i_drag_element_and_drop_it_into_container_in_driver(
         self,
         driver: AppDriver,
         element: Selector,
         container: Selector,
 ):
     driver.drag_and_drop(element, container)
Example #3
0
 def i_long_press_key_in_driver(
         self,
         driver: AppDriver,
         long: Optional[str],
         key: str,
 ):
     driver.press_key(key)
Example #4
0
 def i_set_selector_value_to_value_in_driver(
         self,
         driver: AppDriver,
         selector: Selector,
         value: str,
 ):
     driver.set_value_by_selector(selector, value)
Example #5
0
 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)
Example #6
0
 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
Example #7
0
 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
Example #8
0
 def i_close_the_main_window_in_driver(
         self,
         driver: AppDriver
 ):
     driver.close_window(self.e2e.variables['windows']['main'])
Example #9
0
 def i_switch_to_window_name_in_driver(
         self,
         driver: AppDriver,
         window_name: str,
 ):
     driver.switch_to_window(self.e2e.variables['windows'][window_name])
Example #10
0
 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)
Example #11
0
 def i_wait_while_selector_appears_in_driver(
         self,
         driver: AppDriver,
         selector: Selector,
 ):
     driver.wait_until_displayed(selector)
Example #12
0
 def i_accept_the_alert_box_by_clicking_on_value_in_driver(
         self,
         driver: AppDriver,
         value: Optional[str]
 ):
     driver.accept_alert()
Example #13
0
 def i_scroll_to_the_element_selector_in_driver(
         self, driver: AppDriver,
         selector: Selector
 ):
     driver.scroll_to(selector)
Example #14
0
 def i_wait_unless_selector_appears_in_driver(
         self,
         driver: AppDriver,
         selector: Selector,
 ):
     driver.wait_until_not_visible(selector)
Example #15
0
 def i_close_the_window_name_in_driver(
         self,
         driver: AppDriver,
         window_name: str
 ):
     driver.close_window(self.e2e.variables['windows'][window_name])
Example #16
0
 def i_close_all_windows_in_driver(
         self,
         driver: AppDriver
 ):
     driver.close_all_windows()
Example #17
0
 def i_dismiss_the_alert_box_by_clicking_on_value_in_driver(
         self,
         driver: AppDriver,
         value: Optional[str]
 ):
     driver.dismiss_alert()