Module: EfsetWidgetHelper

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

Instance Method Summary collapse

Instance Method Details

#certificate_badgeObject



29
30
31
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 29

def certificate_badge
  plugin_iframe.span(id: 'combined-badge', class: /badge-combined-efset-.*/)
end

#certificate_plus_badgeObject



33
34
35
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 33

def certificate_plus_badge
  plugin_iframe.span(id: 'combined-badge', class: /badge-combined-efset-plus-.*/)
end

#combined_results_badgeObject



25
26
27
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 25

def combined_results_badge
  plugin_iframe.span(id: 'combined-badge', class: /badge-combined-efset-.*/)
end

#fill_demographicObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 7

def fill_demographic
  plugin_iframe.radio(id: 'field_gender_2').when_present(30).set
  plugin_iframe.select_list(id: 'field_bd_year').select_value '1984'
  plugin_iframe.select_list(id: 'field_country_code').select_value 'GB'
  plugin_iframe.text_field(id: 'field_city').set 'London'
  plugin_iframe.text_field(id: 'field_telephone').set '+ 44 7443375832'
  plugin_iframe.select_list(id: 'field_reason').select_value 'I am an English teacher'
  plugin_iframe.select_list(id: 'field_method').select_value 'I want to study abroad'
  plugin_iframe.text_field(id: 'field_email').set '[email protected]' if plugin_iframe.text_field(id: 'field_email').visible?
  sleep 0.5
  plugin_iframe.checkbox(id: 'field_subscribe').click
  plugin_iframe.link(id: 'form-submit', :class => 'eft-button eft-button-black-white').click
end

#fixed_badgeObject



21
22
23
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 21

def fixed_badge
  plugin_iframe.span(id: 'fixed-badge', class: /eft-badge eft-img-center badge-fixed-.*/)
end

#plugin_iframeObject



3
4
5
# File 'lib/efset_test_helper/efset_apps/efset_widget_helper.rb', line 3

def plugin_iframe
  iframe
end