Exemple #1
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    actions.verify_element_has_not_attribute('#button-one', 'not-this-one')
    golem_steps.assert_last_step_message(
        'Verify element #button-one has not attribute not-this-one')
    actions.verify_element_has_not_attribute('#button-one', 'onclick')
    golem_steps.assert_last_error('element #button-one has attribute onclick')
def test(data):
    actions.navigate(data.env.url + 'elements/')
    actions.verify_element_has_not_attribute('#button-one', 'not-this-one')
    try:
        actions.verify_element_has_attribute('#button-one', 'onclick')
    except Exception as e:
        assert 'element #button-one has attribute onclick' in e.args[0]
def test(data):
    actions.navigate(data.env.url+'dynamic-elements/?delay=3')
    element = '#button-nine'
    attribute = 'verified'
    actions.verify_element_has_attribute(element, attribute)
    actions.wait_for_element_has_not_attribute(element, attribute, 5)
    golem_steps.assert_last_step_message('Wait for element #button-nine to not have verified attribute')
    actions.verify_element_has_not_attribute(element, attribute)
    actions.navigate(data.env.url + 'dynamic-elements/?delay=5')
    msg = "Timeout waiting for element {} to not have attribute {}".format(element, attribute)
    with expected_exception(TimeoutException, msg):
        actions.wait_for_element_has_not_attribute(element, attribute, 3)
Exemple #4
0
def test(data):
    actions.navigate(data.env.url+'dynamic-elements/?delay=3')
    browser = actions.get_browser()
    element = '#button-nine'
    attribute = 'verified'
    actions.verify_element_has_attribute(element, attribute)
    browser.find(element).wait_has_not_attribute(attribute, timeout=5)
    actions.verify_element_has_not_attribute(element, attribute)
    actions.navigate(data.env.url + 'dynamic-elements/?delay=5')
    msg = "Timeout waiting for element {} to not have attribute {}".format(element, attribute)
    with expected_exception(Exception, msg):
        browser.find(element).wait_has_not_attribute(attribute, timeout=3)
def test(data):
    actions.navigate(data.env.url + 'dynamic-elements/?delay=3')
    element = '#button-height'
    attribute = 'verified'
    actions.verify_element_has_not_attribute(element, attribute)
    actions.get_browser().wait_for_element_has_attribute(element, attribute, 5)
    actions.verify_element_has_attribute(element, attribute)
    actions.navigate(data.env.url + 'dynamic-elements/?delay=5')
    msg = 'Timeout waiting for element {} to have attribute {}'.format(
        element, attribute)
    with expected_exception(Exception, msg):
        actions.get_browser().wait_for_element_has_attribute(
            element, attribute, 3)