Module: TestPluginElements
- Defined in:
- lib/efset_test_helper/efset_apps/test_plugin_elements.rb
Instance Method Summary collapse
- #click_start ⇒ Object
- #confirm_audio ⇒ Object
- #confirm_next_task ⇒ Object
-
#continue_next_task ⇒ Object
Next task.
- #page_container_text ⇒ Object
-
#play_icon ⇒ Object
Audio check / Audio play.
- #select_dropdown(index) ⇒ Object
- #select_radio(index) ⇒ Object
-
#skip_instructions ⇒ Object
Page / Test Instructions.
-
#task_instructions ⇒ Object
Tasks.
-
#test_plugin_iframe ⇒ Object
Main container.
- #test_plugin_iframe_client ⇒ Object
Instance Method Details
#click_start ⇒ Object
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_audio ⇒ Object
46 47 48 |
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 46 def confirm_audio test_plugin_iframe.(text: 'Yes') end |
#confirm_next_task ⇒ Object
58 59 60 |
# File 'lib/efset_test_helper/efset_apps/test_plugin_elements.rb', line 58 def confirm_next_task test_plugin_iframe.(class: 'button--next-button button button--type-primary', text: 'Next').click end |
#continue_next_task ⇒ Object
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.(class: 'next-button').click end |
#page_container_text ⇒ Object
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_icon ⇒ Object
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].(class: 'dropdown__button').click sleep 0.5 test_plugin_iframe.sections(class: 'item item--dropdown')[0].(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_instructions ⇒ Object
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.(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 (css: '.next-button').wait_until_visible(10).click end end |
#task_instructions ⇒ Object
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_iframe ⇒ Object
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_client ⇒ Object
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 |