def test(data): actions.navigate(data.env.url+'special-elements/') actions.verify_element_present('#double-click-one') try: actions.verify_element_present('#does-not-exist') except Exception as e: assert 'element is not present' in e.args[0]
def test(data): actions.navigate(data.env.url + 'dynamic-elements/?delay=3') actions.get_browser().wait_for_element_present('#button-five', 5) actions.verify_element_present('#button-five') actions.navigate(data.env.url + 'dynamic-elements/?delay=5') msg = "timeout waiting for element #button-five to be present" with expected_exception(Exception, msg): actions.get_browser().wait_for_element_present('#button-five', 3)
def test(data): actions.navigate(data.env.url + 'dynamic-elements/?delay=3') actions.wait_for_element_present('#button-five', 10) golem_steps.assert_last_step_message( 'Wait for element #button-five to be present') actions.verify_element_present('#button-five') actions.navigate(data.env.url + 'dynamic-elements/?delay=5') msg = "timeout waiting for element #button-five to be present" with expected_exception(TimeoutException, msg): actions.wait_for_element_present('#button-five', 3)
def test(data): actions.navigate(data.env.url + 'dynamic-elements/?delay=3') actions.wait_for_element_present('#button-five', 10) actions.verify_element_present('#button-five') actions.navigate(data.env.url + 'dynamic-elements/?delay=5') try: actions.wait_for_element_present('#button-five', 3) except Exception as e: assert "Element #button-five not found using selector css:'#button-five'" in e.args[ 0]
def test(data): actions.navigate(data.env.url + 'dynamic-elements/?delay=3') actions.verify_element_present('#button-six') actions.wait_for_element_not_present('#button-six', timeout=10) actions.verify_element_not_present('#button-six') # when element does not exist no exception is thrown actions.wait_for_element_not_present('#this-element-does-not-exist', timeout=3) # wait times out and element is still present actions.navigate(data.env.url + 'elements/') try: actions.wait_for_element_not_present('#button-one', timeout=3) except Exception as e: assert "Timeout waiting for element #button-one to not be present" in e.args[ 0]
def test(data): browser = actions.get_browser() actions.navigate(data.env.url + 'dynamic-elements/?delay=3') actions.verify_element_present('#button-six') browser.wait_for_element_not_present('#button-six', timeout=10) actions.verify_element_not_present('#button-six') # when element does not exist no exception is thrown browser.wait_for_element_not_present('#this-element-does-not-exist', timeout=3) # pass a webelement object to the method actions.navigate(data.env.url + 'dynamic-elements/?delay=5') actions.verify_element_present('#button-six') button = browser.find('#button-six', timeout=0) browser.wait_for_element_not_present(button, timeout=10) # wait times out and element is still present actions.navigate(data.env.url + 'elements/') msg = "Timeout waiting for element #button-one to not be present" with expected_exception(Exception, msg): browser.wait_for_element_not_present('#button-one', timeout=3)
def test(data): actions.click(test_builder.code_button) actions.verify_element_present(test_builder_code.preview_button)
def test(data): actions.navigate(data.env.url+'special-elements/') actions.verify_element_present('#double-click-one') golem_steps.assert_last_step_message('Verify element #double-click-one is present') actions.verify_element_present('#does-not-exist') golem_steps.assert_last_error('element #does-not-exist is not present')