def _type_in_field(self, add_locator, field_locator, value): Wait(self.marionette).until( expected.element_present(*add_locator)).tap() element = Wait(self.marionette).until( expected.element_present(*field_locator)) Wait(self.marionette).until(expected.element_displayed(element)) element.clear() element.send_keys(value)
def email(self, value): """Set the value of the email field.""" email = Wait(self.driver, self.timeout).until( expected.element_present(*self._email_input_locator)) Wait(self.driver, self.timeout).until(expected.element_displayed(email)) email.clear() email.send_keys(value)
def email(self, value): """Set the value of the email field.""" email = Wait(self.driver, self.timeout).until( expected.element_present(*self._email_input_locator)) Wait(self.driver, self.timeout).until( expected.element_displayed(email)) email.clear() email.send_keys(value)
def select_when_use_is_above_unit_and_value(self, unit, value): when_use_is_above_button = self.marionette.find_element(*self._when_use_is_above_button_locator) Wait(self.marionette).until(lambda m: when_use_is_above_button.get_attribute('disabled') == 'false') when_use_is_above_button.tap() current_unit = Wait(self.marionette).until( expected.element_present(*self._unit_button_locator)) Wait(self.marionette).until(expected.element_displayed(current_unit)) if current_unit.text != unit: current_unit.tap() # We need to wait for the javascript to do its stuff Wait(self.marionette).until(lambda m: current_unit.text == unit) # clear the original assigned value and set it to the new value size = Wait(self.marionette).until(expected.element_present(*self._size_input_locator)) Wait(self.marionette).until(expected.element_displayed(size)) size.clear() size.send_keys(value) self.marionette.find_element(*self._usage_done_button_locator).tap()
def select_when_use_is_above_unit_and_value(self, unit, value): when_use_is_above_button = self.marionette.find_element( *self._when_use_is_above_button_locator) Wait(self.marionette).until(lambda m: when_use_is_above_button. get_attribute('disabled') == 'false') when_use_is_above_button.tap() current_unit = Wait(self.marionette).until( expected.element_present(*self._unit_button_locator)) Wait(self.marionette).until(expected.element_displayed(current_unit)) if current_unit.text != unit: current_unit.tap() # We need to wait for the javascript to do its stuff Wait(self.marionette).until(lambda m: current_unit.text == unit) # clear the original assigned value and set it to the new value size = Wait(self.marionette).until( expected.element_present(*self._size_input_locator)) Wait(self.marionette).until(expected.element_displayed(size)) size.clear() size.send_keys(value) self.marionette.find_element(*self._usage_done_button_locator).tap()
def _type_in_field(self, add_locator, field_locator, value): Wait(self.marionette).until(expected.element_present(*add_locator)).tap() element = Wait(self.marionette).until(expected.element_present(*field_locator)) Wait(self.marionette).until(expected.element_displayed(element)) element.clear() element.send_keys(value)