Example #1
0
 def assert_element_attribute_is_or_contains_stored_value(
         negate, attribute, element_name, type_of_match,
         upper_lower, name):
     current = _get_attribute_of_element(element_name, attribute)
     stored = world.stored_values[name]
     if upper_lower:
         stored, current = transform_for_upper_lower_comparison(
             stored, current, upper_lower)
     assert_value(type_of_match, stored, current, negate)
     return True
Example #2
0
 def assert_alert_with_stored_value(negate, type_of_match, upper_lower, name):
     world.prompt = _get_alert_or_none()
     assert world.stored_values[name]
     stored = world.stored_values[name]
     current = world.prompt.text
     if upper_lower:
         stored, current = transform_for_upper_lower_comparison(stored, current, upper_lower)
     prompt_exists = world.prompt is not None
     text_exists = None
     if "contains" in type_of_match:
         text_exists = stored in current
     else:
         text_exists = stored == current
     assert_with_negate(prompt_exists and text_exists, negate)
     if world.prompt:
         world.prompt.accept()
     return True
Example #3
0
 def assert_alert_with_stored_value(negate, type_of_match, upper_lower,
                                    name):
     world.prompt = _get_alert_or_none()
     assert world.stored_values[name]
     stored = world.stored_values[name]
     current = world.prompt.text
     if upper_lower:
         stored, current = transform_for_upper_lower_comparison(
             stored, current, upper_lower)
     prompt_exists = world.prompt is not None
     text_exists = None
     if 'contains' in type_of_match:
         text_exists = stored in current
     else:
         text_exists = stored == current
     assert_with_negate(prompt_exists and text_exists, negate)
     if world.prompt:
         world.prompt.accept()
     return True