Ejemplo n.º 1
0
def test(data):
    # switch to iframe by frame name
    actions.navigate(data.env.url + 'iframes/')
    actions.switch_to_frame('iframe-bottom')
    actions.switch_to_frame('iframe-bottom-left')
    actions.verify_page_contains_text('IFrame Bottom Left')
    actions.verify_page_not_contains_text('IFrames')
    actions.verify_page_not_contains_text('id="button-bottom"')
    # switch to default content
    actions.switch_to_default_content()
    actions.verify_page_contains_text('IFrames')
    actions.verify_page_not_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('IFrame Bottom Left')
Ejemplo n.º 2
0
def test_switch_to_default_content_frame(data):
    # switch to frame
    actions.navigate(data.env.url + 'frames/')
    # first frame in frameset is considered main content
    actions.verify_page_contains_text('Top')
    actions.switch_to_frame('frame-bottom')
    # switch to nested frame
    actions.switch_to_frame('frame-bottom-left')
    actions.verify_page_contains_text('Bottom Left')
    actions.verify_page_not_contains_text('Top')
    actions.verify_page_not_contains_text('Bottom Right')
    # switch back to parent frame
    actions.switch_to_parent_frame()
    actions.switch_to_parent_frame()
    actions.verify_page_contains_text('Top')
    actions.verify_page_not_contains_text('Bottom Right')
    actions.verify_page_not_contains_text('Bottom Left')
def test(data):
    # switch to frame
    actions.navigate(data.env.url + 'frames/')
    # first frame in frameset is considered main content
    actions.assert_page_contains_text('Top')
    actions.switch_to_frame('frame-bottom')
    # switch to nested frame
    actions.switch_to_frame('frame-bottom-left')
    actions.assert_page_contains_text('Bottom Left')
    actions.assert_page_not_contains_text('Top')
    actions.assert_page_not_contains_text('Bottom Right')
    # switch to default content
    actions.switch_to_parent_frame()
    golem_steps.assert_last_step_message('Switch to parent frame')
    actions.switch_to_parent_frame()
    actions.assert_page_contains_text('Top')
    actions.assert_page_not_contains_text('Bottom Right')
    actions.assert_page_not_contains_text('Bottom Left')
Ejemplo n.º 4
0
def test(data):
    actions.navigate(data.env.url+'iframes/')
    # switch to iframe
    actions.switch_to_frame('iframe-bottom')
    actions.verify_page_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('Iframes')
    # switch to nested iframe
    actions.switch_to_frame('iframe-bottom-left')
    actions.verify_page_contains_text('IFrame Bottom Left')
    actions.verify_page_not_contains_text('Iframe Bottom')
    # switch back to parent iframe
    actions.switch_to_parent_frame()
    actions.verify_page_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('Iframe Bottom Left')
    actions.verify_page_not_contains_text('IFrames')
    # switch back to main content
    actions.switch_to_parent_frame()
    actions.verify_page_contains_text('IFrames')
    actions.verify_page_not_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('Iframe Bottom Left')
Ejemplo n.º 5
0
def test(data):
    # switch to iframe by frame name
    actions.navigate(data.env.url + 'iframes/')
    actions.switch_to_frame('iframe-top')
    actions.verify_page_contains_text('IFrame Top')
    actions.verify_page_not_contains_text('IFrames')
    actions.click('#button-top')
    actions.verify_element_text('#button-top-result', 'Clicked!')
    # switch to iframe by index
    actions.navigate(data.env.url + 'iframes/')
    actions.switch_to_frame(1)
    actions.verify_page_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('IFrames')
    actions.click('#button-bottom')
    actions.verify_element_text('#button-bottom-result', 'Clicked!')
    # switch to iframe by webelement
    actions.navigate(data.env.url + 'iframes/')
    frame_element = actions.get_browser().find('#iframeBottom')
    actions.switch_to_frame(frame_element)
    actions.verify_page_contains_text('IFrame Bottom')
    actions.verify_page_not_contains_text('IFrames')
    actions.click('#button-bottom')
    actions.verify_element_text('#button-bottom-result', 'Clicked!')
Ejemplo n.º 6
0
def test(data):
    # switch to frame by frame name
    actions.navigate(data.env.url+'frames/')
    actions.switch_to_frame('frame-top')
    actions.verify_page_contains_text('Top')
    actions.verify_page_not_contains_text('Bottom Right')
    actions.click('#button-top')
    actions.verify_element_text('#button-top-result', 'Clicked!')
    # switch to frame by index
    actions.navigate(data.env.url + 'frames/')
    actions.switch_to_frame(0)
    golem_steps.assert_last_step_message('Switch to frame 0')
    actions.verify_page_contains_text('Top')
    actions.verify_page_not_contains_text('Bottom Right')
    actions.click('#button-top')
    actions.verify_element_text('#button-top-result', 'Clicked!')
    # switch to frame by webelement
    actions.navigate(data.env.url + 'frames/')
    frame_element = actions.get_browser().find('#frameTop')
    actions.switch_to_frame(frame_element)
    actions.verify_page_contains_text('Top')
    actions.verify_page_not_contains_text('Bottom Right')
    actions.click('#button-top')
    actions.verify_element_text('#button-top-result', 'Clicked!')