Module: TestPluginElements

Defined in:
lib/efset_test_helper/efset_apps/test_plugin_elements.rb

Instance Method Summary collapse

Instance Method Details

#click_startObject



34
35
36
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 34

def click_start
  test_plugin_iframe.a(id: 'start-btn').when_present(10).click
end

#confirm_audioObject



46
47
48
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 46

def confirm_audio
  test_plugin_iframe.button(text: 'Yes')
end

#confirm_next_taskObject



58
59
60
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 58

def confirm_next_task
  test_plugin_iframe.button(class: 'button--next-button button button--type-primary', text: 'Next').click
end

#continue_next_taskObject

Next task



54
55
56
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 54

def continue_next_task
  test_plugin_iframe.button(class: 'next-button').click
end

#page_container_textObject



30
31
32
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 30

def page_container_text
  test_plugin_iframe.div(class: 'page-container').when_present(10).text
end

#play_iconObject

Audio check / Audio play



42
43
44
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 42

def play_icon
  test_plugin_iframe.div(class: 'audio-control-button audio-control-button--play')
end

#select_dropdown(index) ⇒ Object



75
76
77
78
79
80
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 75

def select_dropdown(index)
  task_instructions.wait_until_present(10)
  test_plugin_iframe.sections(class: 'item item--dropdown')[0].button(class: 'dropdown__button').click
  sleep 0.5
  test_plugin_iframe.sections(class: 'item item--dropdown')[0].buttons(class: 'dropdown__option')[index].click
end

#select_radio(index) ⇒ Object



70
71
72
73
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 70

def select_radio(index)
  # task_instructions.wait_until_present(10)
  test_plugin_iframe.divs(class: 'options-selection__option__checkbox')[index].click
end

#skip_instructionsObject

Page / Test Instructions



18
19
20
21
22
23
24
25
26
27
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 18

def skip_instructions
  begin
  test_plugin_iframe.button(class: 'next-button').click
  rescue Watir::Wait::TimeoutError
    puts 'Could not select next. Trying again.'
    driver.switch_to.test_plugin_iframe
    driver.switch_to.test_plugin_iframe_client
    button(css: '.next-button').wait_until_visible(10).click
  end
end

#task_instructionsObject

Tasks



66
67
68
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 66

def task_instructions
  test_plugin_iframe.div(class: 'instructions')
end

#test_plugin_iframeObject

Main container



7
8
9
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 7

def test_plugin_iframe
  iframe(id: 'athena-iframe')
end

#test_plugin_iframe_clientObject



11
12
13
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 11

def test_plugin_iframe_client
  iframe(id: 'athena-client-iframe')
end