def test(data): actions.navigate(data.env.url + 'elements/') b = actions.get_browser() text_input = b.find(id='input-one') actions.focus_element(text_input) active_element = actions.get_active_element() assert active_element == actions.get_browser().switch_to.active_element
def test(data): actions.navigate(data.env.url + 'elements/') actions.verify_element_has_not_focus('#input-one') golem_steps.assert_last_step_message( 'Verify element #input-one does not have focus') actions.focus_element('#input-one') actions.verify_element_has_not_focus('#input-one') golem_steps.assert_last_error('element #input-one has focus')
def test(data): actions.navigate(data.env.url + 'elements/') actions.verify_element_has_not_focus('#input-one') actions.focus_element('#input-one') try: actions.verify_element_has_not_focus('#input-one') except Exception as e: assert 'element #input-one has focus' in e.args[0]
def test_assert_element_has_not_focus(data): actions.navigate(data.env.url + 'elements/') actions.assert_element_has_not_focus('#input-one') golem_steps.assert_last_step_message( 'Assert element #input-one does not have focus') actions.focus_element('#input-one') with expected_exception(AssertionError, 'element #input-one has focus'): actions.assert_element_has_not_focus('#input-one')
def test(data): actions.navigate(data.env.url + 'elements/') b = actions.get_browser() text_input = b.find(id='input-one') text_area = b.find(id='textarea-1') actions.focus_element(text_input) assert text_input.has_focus() actions.focus_element(text_area) assert not text_input.has_focus() assert text_area.has_focus()
def test(data): actions.navigate(data.env.url + 'elements/') b = actions.get_browser() text_input = b.find(id='input-one') text_area = b.find(id='textarea-1') actions.focus_element(text_input) golem_steps.assert_last_step_message('Focus element input-one') assert text_input.has_focus() actions.focus_element(text_area) assert not text_input.has_focus() assert text_area.has_focus()