def test(data): actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.send_text_to_alert('hey, some text') golem_steps.assert_last_step_message("Send 'hey, some text' to alert") actions.accept_alert() actions.verify_text_in_element('#result', 'hey, some text')
def test(data): actions.navigate(data.env.url + 'elements/') actions.press_key(('id', 'input-one'), 'NUMPAD2') actions.verify_text_in_element(('id', 'input-one-input-result'), 'Welcome 2') try: actions.press_key(('id', 'input-one'), 'UNDEFINED_KEY') except Exception as e: assert 'Key UNDEFINED_KEY is invalid' in e.args[0]
def test(data): actions.navigate(data.env.url + 'elements/') element = actions.get_browser().find('#input-one') element.press_key('NUMPAD2') actions.verify_text_in_element('#input-one-input-result', 'Welcome 2') try: element = actions.get_browser().find('#input-one') element.press_key('UNDEFINED_KEY') except Exception as e: assert 'Key UNDEFINED_KEY is invalid' in e.args[0] else: raise AssertionError('expected an exception')
def test(data): # alert actions.navigate(data.env.url + 'alert/') actions.click('#alert-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', '1') # confirm actions.navigate(data.env.url + 'confirm/') actions.click('#confirm-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', 'NOT CONFIRMED') # prompt actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', 'DISMISSED')
def test(data): actions.navigate(data.env.url + 'elements/') element = actions.get_browser().find('#button-one') element.javascript_click() actions.verify_text_in_element(('id', 'button-one-result'), 'Clicked!')
def test(data): actions.navigate(data.env.url + 'elements/') actions.send_keys('#input-one', 'some text') actions.verify_text_in_element('#input-one-input-result', 'Welcome some text')
def test(data): actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.send_text_to_alert('hey, some text') actions.accept_alert() actions.verify_text_in_element('#result', 'hey, some text')
def test(data): actions.navigate(data.env.url+'elements/') actions.javascript_click(('id', 'button-one')) golem_steps.assert_last_step_message('Javascript click element button-one') actions.verify_text_in_element(('id', 'button-one-result'), 'Clicked!')
def test(data): actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.submit_prompt_alert('hey, some text') golem_steps.assert_last_step_message("Submit alert with text 'hey, some text'") actions.verify_text_in_element('#result', 'hey, some text')
def test(data): actions.navigate(data.env.url + 'elements/') actions.javascript_click(('id', 'button-one')) actions.verify_text_in_element(('id', 'button-one-result'), 'Clicked!')