def test(data):
    actions.navigate(data.env.url + 'elements/')
    select = ('id', 'select-1')
    actions.select_option_by_value(select, 'option-saab')
    actions.verify_selected_option(select, 'Saab')
Exemple #2
0
def test_get_cookies(data):
    actions.navigate('https://google.com')
    actions.add_cookie({'name': 'foo', 'value': 'bar'})
    cookies = actions.get_cookies()
    assert [x for x in cookies if x['value'] == 'bar']
def test(data):
    actions.navigate(data.env.url+'special-elements/')
    actions.assert_element_displayed('#double-click-one')
    golem_steps.assert_last_step_message('Assert element #double-click-one is displayed')
    with expected_exception(AssertionError, 'element #hidden-button is not displayed'):
        actions.assert_element_displayed('#hidden-button')
Exemple #4
0
def test(data):
    actions.navigate(data.env.url)
    result = actions.execute_javascript('return arguments[0] + arguments[1]',
                                        'a', 'b')
    assert result == 'ab'
Exemple #5
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    actions.send_keys('#input-one', 'some text')
    golem_steps.assert_last_step_message("Write 'some text' in element #input-one")
    actions.assert_element_text('#input-one-input-result', 'Welcome some text')
Exemple #6
0
def test(data):
    actions.navigate(data.env.url+'special-elements/')
    actions.verify_element_not_displayed('#hidden-button')
    golem_steps.assert_last_step_message('Verify element #hidden-button is not displayed')
    actions.verify_element_not_displayed('#double-click-one')
    golem_steps.assert_last_error('element #double-click-one is displayed')
def test(data):
    actions.navigate(data.env.url)
    actions.add_cookie({'name': 'foo', 'value': 'bar'})
    actions.verify_cookie_value('foo', 'bar')
Exemple #8
0
def test(data):
    actions.navigate(data.env.url + 'special-elements/')
    actions.double_click(('id', 'double-click-one'))
    assert element(('id', 'double-click-one-result')).text == 'Double 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 + 'project/'+data.project+'/suite/not_existent/')
    actions.assert_page_contains_text('The suite not_existent does not exist')
Exemple #11
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    element = actions.get_browser().find('#select-1')
    select = element.select
    assert type(select) is Select
Exemple #12
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    logo = element('a.logo')
    assert logo.outer_html == '<a class="logo" href="/"><strong>Web Playground</strong></a>'
Exemple #13
0
def test(data):
    actions.navigate(data.env.url + 'special-elements/')
    button = actions.get_browser().find('#mouse-over-one')
    button.mouse_over()
    assert element('#mouse-over-one-result').text == 'Mouse over!'
Exemple #14
0
def access_golem(url, user):
    """navigate to url and log in to Golem GUI"""
    actions.navigate(url)
    login.login(user['username'], user['password'])
Exemple #15
0
def test(data):
    error_msg = 'The project not_existent does not exist.'
    for url in data.urls:
        actions.navigate(data.env.url + url)
        actions.assert_page_contains_text(error_msg)
Exemple #16
0
def test(data):
    actions.navigate(urls.test(data.project, 'not_existent_test'))
    actions.assert_page_contains_text('The test not_existent_test does not exist')
def test(data):
    actions.navigate(data.env.url)
    assert actions.get_current_url() == data.env.url
Exemple #18
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    element = actions.get_browser().find('#input-one')
    assert element.value == ''
    element.send_keys('some value')
    assert element.value == 'some value'
Exemple #19
0
def test(data):
    actions.navigate(data.env.url+'elements/')
    actions.verify_title_is_not('incorrect title')
    golem_steps.assert_last_step_message("Verify page title is not 'incorrect title'")
    actions.verify_title_is_not('Web Playground - Elements')
    golem_steps.assert_last_error("expected title to not be 'Web Playground - Elements'")
def test(data):
    actions.navigate(data.env.url + 'project/test/page/not_existent/code/')
    actions.assert_page_contains_text('The page not_existent does not exist')
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')
Exemple #22
0
def test(data):
    actions.navigate(data.env.url+'special-elements/')
    actions.mouse_over(('id', 'mouse-over-one'))
    assert element(('id', 'mouse-over-one-result')).text == 'Mouse over!'
Exemple #23
0
def test_alert_not_present(data):
    actions.navigate(data.env.url + 'alert/')
    actions.accept_alert(ignore_not_present=True)
    with expected_exception(NoAlertPresentException):
        actions.accept_alert()
Exemple #24
0
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!')
Exemple #25
0
def test(data):
    actions.navigate(data.env.url)
    assert actions.get_window_title() == 'Web Playground'
    actions.navigate(data.env.url + 'elements/')
    assert actions.get_window_title() == 'Web Playground - Elements'
Exemple #26
0
def test(data):
    actions.navigate(data.env.url)
    actions.click(('link_text', 'Elements'))
    assert browser.get_browser().current_url == data.env.url + 'elements/'
    actions.go_back()
    assert browser.get_browser().current_url == data.env.url
Exemple #27
0
def test(data):
    actions.navigate('https://google.com')
    actions.add_cookie({'name': 'foo', 'value': 'bar'})
    cookie = actions.get_cookie('foo')
    assert cookie['value'] == 'bar'
Exemple #28
0
def test(data):
    actions.navigate(data.env.url + 'elements/')
    assert actions.get_element_text('h1') == 'Common Elements'
    assert actions.get_element_text("label[for='selected-checkbox']") == 'Selected Checkbox'
Exemple #29
0
def test_get_browser(data):
    actions.navigate(data.env.url)
    assert actions.get_browser() == execution.browser
Exemple #30
0
def test_delete_cookie(data):
    actions.navigate('https://google.com')
    actions.add_cookie({'name': 'foo', 'value': 'bar'})
    actions.delete_cookie('foo')
    golem_steps.assert_last_step_message("Delete cookie 'foo'")
    assert actions.get_cookie('foo') is None