def test_assert_element_not_displayed(data):
    actions.navigate(data.env.url + 'special-elements/')
    actions.assert_element_not_displayed('#hidden-button')
    golem_steps.assert_last_step_message(
        'Assert element #hidden-button is not displayed')
    with expected_exception(AssertionError,
                            'element #double-click-one is displayed'):
        actions.assert_element_not_displayed('#double-click-one')
Ejemplo n.º 2
0
def test(data):
    suite_builder.run_suite()
    suite_builder.access_suite_execution_from_toast()
    report_execution.assert_report_is_running()
    report_execution.wait_until_execution_end()
    report_execution.assert_amount_of_tests(3)
    actions.assert_element_not_displayed(report_execution.main_spinner)
    report_execution.assert_result_of_test('success_test', 'success')
    report_execution.assert_result_of_test('failing_test', 'failure')
    report_execution.assert_result_of_test('error_test', 'error')
    report_execution.assert_general_total_row(columns={
        'Total Tests': '3',
        'Success': '1',
        'Failure': '1',
        'Error': '1'
    })
Ejemplo n.º 3
0
def test(data):
    actions.assert_element_not_checked(test_builder.skip_checkbox)
    actions.assert_element_not_displayed(test_builder.skip_message_input)
    actions.check_element(test_builder.skip_checkbox)
    actions.assert_element_displayed(test_builder.skip_message_input)
    actions.assert_element_value(test_builder.skip_message_input, '')
    test_builder.save_test_and_refresh_page()
    actions.assert_element_checked(test_builder.skip_checkbox)
    actions.assert_element_displayed(test_builder.skip_message_input)
    actions.assert_element_value(test_builder.skip_message_input, '')
    actions.send_keys(test_builder.skip_message_input, 'skip message')
    test_builder.save_test_and_refresh_page()
    actions.assert_element_checked(test_builder.skip_checkbox)
    actions.assert_element_displayed(test_builder.skip_message_input)
    actions.assert_element_value(test_builder.skip_message_input,
                                 'skip message')
    actions.uncheck_element(test_builder.skip_checkbox)
    test_builder.save_test()
    actions.assert_element_not_checked(test_builder.skip_checkbox)
    actions.assert_element_not_displayed(test_builder.skip_message_input)
Ejemplo n.º 4
0
def test(data):
    actions.navigate(data.env.url + 'dynamic-elements/?delay=3')
    button = '#button-two'
    actions.get_browser().wait_for_element_not_displayed(button, timeout=5)
    actions.verify_element_not_displayed(button)
    # time out waiting for element to be not displayed
    actions.navigate(data.env.url + 'dynamic-elements/?delay=5')
    msg = 'Timeout waiting for element {} to be not displayed'.format(button)
    with expected_exception(Exception, msg):
        actions.get_browser().wait_for_element_not_displayed(button, timeout=3)
    # element is not displayed from the beginning
    # wait_for_element_not_displayed is ignored
    button = '#hidden-button'
    actions.navigate(data.env.url + 'special-elements/')
    actions.assert_element_not_displayed(button)
    actions.get_browser().wait_for_element_not_displayed(button, timeout=2)
    # element is not present
    # wait_for_element_not_displayed throws ElementNotFound
    with expected_exception(ElementNotFound):
        actions.get_browser().wait_for_element_not_displayed('#non-existent',
                                                             timeout=2)