testcentricity_web 4.1.6 → 4.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile.lock +2 -2
  4. data/Rakefile +32 -9
  5. data/config/cucumber.yml +20 -7
  6. data/config/test_data/data.json +12 -0
  7. data/config/test_data/data.xls +0 -0
  8. data/config/test_data/data.yml +12 -0
  9. data/features/basic_test_page_css.feature +11 -0
  10. data/features/basic_test_page_xpath.feature +3 -0
  11. data/features/media_players.feature +87 -0
  12. data/features/step_definitions/generic_steps.rb.rb +7 -0
  13. data/features/step_definitions/media_steps.rb +30 -0
  14. data/features/support/env.rb +14 -7
  15. data/features/support/pages/base_test_page.rb +11 -0
  16. data/features/support/pages/basic_css_test_page.rb +8 -5
  17. data/features/support/pages/basic_test_page.rb +67 -8
  18. data/features/support/pages/basic_xpath_test_page.rb +8 -4
  19. data/features/support/pages/custom_controls_page.rb +16 -0
  20. data/features/support/pages/indexed_sections_page.rb +16 -0
  21. data/features/support/pages/media_test_page.rb +195 -0
  22. data/features/support/sections/header_nav.rb +28 -0
  23. data/features/support/world_data.rb +12 -0
  24. data/features/support/world_pages.rb +3 -0
  25. data/lib/testcentricity_web/data_objects/environment.rb +12 -0
  26. data/lib/testcentricity_web/version.rb +1 -1
  27. data/lib/testcentricity_web/web_core/page_object.rb +1 -8
  28. data/lib/testcentricity_web/web_elements/checkbox.rb +3 -4
  29. data/lib/testcentricity_web/web_elements/media.rb +50 -4
  30. data/lib/testcentricity_web/web_elements/radio.rb +5 -1
  31. data/test_site/basic_test_page.html +51 -1
  32. data/test_site/custom_controls_page.html +58 -0
  33. data/test_site/indexed_sections_page.html +58 -0
  34. data/test_site/media/MIB2-subtitles-pt-BR.vtt +49 -0
  35. data/test_site/media/MIB2.mp4 +0 -0
  36. data/test_site/media_page.html +60 -7
  37. metadata +25 -4
  38. data/features/support/pages/media_page.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98ea25aaf7cff4f07b966b6cac829a2cd6ad3234403e3a01257ff6dd07beaf38
4
- data.tar.gz: 20082c59c2d9f7c5e69959500b4bc97e10f1dc93309f1ec601acdf7b0cf8d29c
3
+ metadata.gz: 58ddfdbcb8747347fcb06efdd2a888509fa904bd5541a0f3d4d303af6469552c
4
+ data.tar.gz: 14f9af8661d7e571d10f79e3d093cafa4e744388d5c1d6f9232e207fe5e82d6f
5
5
  SHA512:
6
- metadata.gz: 40ccfaa119abc07f1bb3254cf05e2c3b5d28548b92c65da43faabc3b524af4b074973767e79da7901de09a609ee95af65e3525ea60b49dd3676b88a6956e7478
7
- data.tar.gz: 1959d24e265fdbb21e088f4192b0de5a86f227d22b0b73870a0ab2ed12430d2b898718d2fcbb4b4330f8ec689bef770d09b3cefa39ec0a0cb75b8ab624078abb
6
+ metadata.gz: 768e113468d0dfc68f01467bc4304f41903bff09f59db9f2c8dd013545c061523c7e0947669d1befadcf43b1187e57df3cb188d803b3d802d905c0c3467ce852
7
+ data.tar.gz: 3133dc1f23ff3a839c45e2c6424d152f6c85916497c00dd9a815113f2acb8225f45efab91ce9d7cb4ada454d33115649ad61f4073f109a7dec44e40891971043
data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [4.1.7] - 28-MAR-2022
6
+
7
+ ### Fixed
8
+ * `CheckBox.set_checkbox_state` and `Radio.set_selected_state` work on iOS simulators again.
9
+
10
+ ### Changes
11
+ * `Audio.playback_rate` and `Video.playback_rate` now return value as a `Float` instead of a `String`.
12
+ * `Audio.default_playback_rate` and `Video.default_playback_rate` now return value as a `Float` instead of a `String`.
13
+ * `Audio.current_time` and `Video.current_time` now return value as a `Float` rounded to two decimal places.
14
+ * `Audio.duration` and `Video.duration` now return value as a `Float` rounded to two decimal places.
15
+
16
+ ### Added
17
+ * `Audio.mute` and `Video.mute` methods added.
18
+ * `Audio.unmute` and `Video.unmute` methods added.
19
+ * `Audio.playback_rate` and `Video.playback_rate` now accept a `Float` value as an input for setting the playback rate
20
+ of media.
21
+ * `Audio.volume` and `Video.volume` now accept a `Float` value between 0 and 1 as an input for setting the volume of media.
22
+
23
+
5
24
  ## [4.1.6] - 21-MAR-2022
6
25
 
7
26
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (4.1.6)
4
+ testcentricity_web (4.1.7)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -50,7 +50,7 @@ GEM
50
50
  chronic (0.10.2)
51
51
  coercible (1.0.0)
52
52
  descendants_tracker (~> 0.0.1)
53
- concurrent-ruby (1.1.9)
53
+ concurrent-ruby (1.1.10)
54
54
  cucumber (7.1.0)
55
55
  builder (~> 3.2, >= 3.2.4)
56
56
  cucumber-core (~> 10.1, >= 10.1.0)
data/Rakefile CHANGED
@@ -5,12 +5,12 @@ require 'rake'
5
5
 
6
6
 
7
7
  namespace :features do
8
- Cucumber::Rake::Task.new(:edge) do |t|
9
- t.profile = 'edge'
8
+ Cucumber::Rake::Task.new(:edge_local) do |t|
9
+ t.profile = 'edge_local'
10
10
  end
11
11
 
12
- Cucumber::Rake::Task.new(:chrome) do |t|
13
- t.profile = 'chrome'
12
+ Cucumber::Rake::Task.new(:chrome_local) do |t|
13
+ t.profile = 'chrome_local'
14
14
  end
15
15
 
16
16
  Cucumber::Rake::Task.new(:edge_headless) do |t|
@@ -21,17 +21,40 @@ namespace :features do
21
21
  t.profile = 'chrome_headless'
22
22
  end
23
23
 
24
- Cucumber::Rake::Task.new(:safari) do |t|
25
- t.profile = 'safari'
24
+ Cucumber::Rake::Task.new(:safari_local) do |t|
25
+ t.profile = 'safari_local'
26
26
  end
27
27
 
28
- Cucumber::Rake::Task.new(:firefox) do |t|
29
- t.profile = 'firefox'
28
+ Cucumber::Rake::Task.new(:firefox_local) do |t|
29
+ t.profile = 'firefox_local'
30
30
  end
31
31
 
32
32
  Cucumber::Rake::Task.new(:firefox_headless) do |t|
33
33
  t.profile = 'firefox_headless'
34
34
  end
35
35
 
36
- task :all => [:edge, :edge_headless, :chrome, :chrome_headless, :safari]
36
+ Cucumber::Rake::Task.new(:edge_grid) do |t|
37
+ t.profile = 'edge_grid'
38
+ end
39
+
40
+ Cucumber::Rake::Task.new(:chrome_grid) do |t|
41
+ t.profile = 'chrome_grid'
42
+ end
43
+
44
+ Cucumber::Rake::Task.new(:firefox_grid) do |t|
45
+ t.profile = 'firefox_grid'
46
+ end
47
+
48
+ Cucumber::Rake::Task.new(:ios_remote) do |t|
49
+ t.profile = 'ios_remote'
50
+ end
51
+
52
+
53
+ task :required => [:edge_local, :edge_headless, :chrome_local, :chrome_headless, :safari_local]
54
+
55
+ task :grid => [:edge_grid, :chrome_grid]
56
+
57
+ task :mobile => [:ios_remote]
58
+
59
+ task :all => [:edge_local, :edge_headless, :chrome_local, :chrome_headless, :safari_local, :edge_grid, :chrome_grid, :ios_remote]
37
60
  end
data/config/cucumber.yml CHANGED
@@ -25,20 +25,29 @@ parallel: PARALLEL=true REPORTING=true --require features --format pretty --form
25
25
  # profiles for locally hosted desktop web browsers
26
26
  #==============
27
27
 
28
- chrome: WEB_BROWSER=chrome <%= desktop %>
28
+ local: TEST_ENVIRONMENT=LOCAL
29
+ chrome: WEB_BROWSER=chrome DATA_SOURCE=yaml <%= desktop %>
30
+ edge: WEB_BROWSER=edge DATA_SOURCE=json <%= desktop %>
31
+ safari: WEB_BROWSER=safari DATA_SOURCE=Excel <%= desktop %>
29
32
  firefox: WEB_BROWSER=firefox <%= desktop %>
30
- edge: WEB_BROWSER=edge <%= desktop %>
31
- safari: WEB_BROWSER=safari <%= desktop %>
32
33
 
33
- firefox_headless: WEB_BROWSER=firefox_headless <%= desktop %>
34
- chrome_headless: WEB_BROWSER=chrome_headless <%= desktop %>
35
- edge_headless: WEB_BROWSER=edge_headless <%= desktop %>
34
+ chrome_local: --profile local --profile chrome
35
+ edge_local: --profile local --profile edge
36
+ safari_local: --profile local --profile safari
37
+ firefox_local: --profile local --profile firefox
38
+
39
+ firefox_headless: --profile local WEB_BROWSER=firefox_headless <%= desktop %>
40
+ chrome_headless: --profile local WEB_BROWSER=chrome_headless <%= desktop %>
41
+ edge_headless: --profile local WEB_BROWSER=edge_headless <%= desktop %>
36
42
 
37
43
 
38
44
  #==============
39
45
  # profile for Selenium Grid and Dockerized Selenium Grid hosted desktop web browsers
40
46
  #==============
41
- grid: SELENIUM=remote REMOTE_ENDPOINT="http://localhost:4444/wd/hub"
47
+ grid: SELENIUM=remote TEST_ENVIRONMENT=REMOTE REMOTE_ENDPOINT="http://localhost:4444/wd/hub"
48
+ chrome_grid: --profile grid --profile chrome
49
+ edge_grid: --profile grid --profile edge
50
+ firefox_grid: --profile grid --profile firefox
42
51
 
43
52
 
44
53
  #==============
@@ -66,6 +75,8 @@ app_ios_15: --profile appium_ios APP_VERSION="15.4"
66
75
  ipad_pro_12_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Pro (12.9-inch) (5th generation)"
67
76
  ipad_air_15_sim: --profile app_ios_15 DEVICE_TYPE=tablet APP_DEVICE="iPad Air (5th generation)" <%= desktop %>
68
77
 
78
+ ios_remote: --profile ipad_pro_12_15_sim --profile run_appium ORIENTATION=portrait TEST_ENVIRONMENT=REMOTE
79
+
69
80
 
70
81
  #==============
71
82
  # profiles for Android mobile web browsers hosted within Android Studio Android Virtual Device emulators
@@ -76,6 +87,8 @@ appium_android: WEB_BROWSER=appium APP_PLATFORM_NAME="Android" <%= desktop %>
76
87
  app_android_12: --profile appium_android APP_BROWSER="Chrome" APP_VERSION="12.0"
77
88
  pixel_c_api31_sim: --profile app_android_12 DEVICE_TYPE=tablet APP_DEVICE="Pixel_C_API_31"
78
89
 
90
+ android_remote: --profile pixel_c_api31_sim --profile run_appium ORIENTATION=portrait TEST_ENVIRONMENT=REMOTE
91
+
79
92
 
80
93
  #==============
81
94
  # profiles for remotely hosted web browsers on the BrowserStack service
@@ -0,0 +1,12 @@
1
+ {
2
+ "Environments": {
3
+ "LOCAL": {
4
+ "PROTOCOL": "file",
5
+ "BASE_URL": "/../../test_site"
6
+ },
7
+ "REMOTE": {
8
+ "PROTOCOL": "http",
9
+ "BASE_URL": "192.168.1.129/test_site"
10
+ }
11
+ }
12
+ }
Binary file
@@ -0,0 +1,12 @@
1
+ # -------------------------------------------------------------
2
+ # This is the generic test data required to run the UAL Flight Booking test suites against the QA and PROD test environments.
3
+ # -------------------------------------------------------------
4
+
5
+ # This section is populated with Environment data required to execute automated test suites on all supported environments
6
+ Environments:
7
+ LOCAL:
8
+ PROTOCOL: "file"
9
+ BASE_URL: "/../../test_site"
10
+ REMOTE:
11
+ PROTOCOL: "http"
12
+ BASE_URL: "192.168.1.129/test_site"
@@ -22,3 +22,14 @@ Feature: Basic HTML Test Page using CSS locators
22
22
  Then I expect the form fields to be correctly populated
23
23
  When I cancel my changes
24
24
  Then I expect the Basic CSS Test page to be correctly displayed
25
+
26
+
27
+ Scenario Outline: Verify functionality of navigation tabs
28
+ When I click the <target_page> navigation tab
29
+ Then I expect the <target_page> page to be correctly displayed
30
+
31
+ Examples:
32
+ |target_page |
33
+ |Media Test |
34
+ |Indexed Sections |
35
+ |Custom Controls |
@@ -1,3 +1,6 @@
1
+ @!grid
2
+
3
+
1
4
  Feature: Basic HTML Test Page using Xpath locators
2
5
  In order to xxx
3
6
  As a xxxx
@@ -0,0 +1,87 @@
1
+
2
+
3
+
4
+ Feature: Basic HTML Test Page using CSS locators
5
+ In order to xxx
6
+ As a xxxx
7
+ I expect to xxxx
8
+
9
+
10
+ Background:
11
+ Given I am on the Media Test page
12
+
13
+
14
+ Scenario: Verify video player play and pause controls
15
+ When I play the video media
16
+ Then the video should be playing
17
+ When I pause the video media
18
+ Then the video should be paused
19
+
20
+
21
+ Scenario: Verify audio player play and pause controls
22
+ When I play the audio media
23
+ Then the audio should be playing
24
+ When I pause the audio media
25
+ Then the audio should be paused
26
+
27
+
28
+ Scenario: Verify video player mute control
29
+ When I mute the video media
30
+ Then the video should be muted
31
+ When I unmute the video media
32
+ Then the video should be unmuted
33
+
34
+
35
+ Scenario: Verify audio player mute control
36
+ When I mute the audio media
37
+ Then the audio should be muted
38
+ When I unmute the audio media
39
+ Then the audio should be unmuted
40
+
41
+
42
+ Scenario: Verify video player volume control
43
+ When I set the volume of the video to .5
44
+ Then the video should have a volume of .5
45
+
46
+
47
+ Scenario: Verify audio player volume control
48
+ When I set the volume of the audio to .5
49
+ Then the audio should have a volume of .5
50
+
51
+
52
+ Scenario: Verify video playback speed settings
53
+ When I play the video with a playback speed of 2x
54
+ Then the video should play at 2x speed
55
+ When I play the video with a playback speed of 0.25x
56
+ Then the video should play at 0.25x speed
57
+ When I play the video with a playback speed of 1.75x
58
+ Then the video should play at 1.75x speed
59
+ When I play the video with a playback speed of 0.5x
60
+ Then the video should play at 0.5x speed
61
+ When I play the video with a playback speed of 1.5x
62
+ Then the video should play at 1.5x speed
63
+ When I play the video with a playback speed of 0.75x
64
+ Then the video should play at 0.75x speed
65
+ When I play the video with a playback speed of 1.25x
66
+ Then the video should play at 1.25x speed
67
+ When I play the video with a playback speed of 1x
68
+ Then the video should play at 1x speed
69
+
70
+
71
+ Scenario: Verify audio playback speed settings
72
+ When I play the audio with a playback speed of 2x
73
+ Then the audio should play at 2x speed
74
+ When I play the audio with a playback speed of 0.25x
75
+ Then the audio should play at 0.25x speed
76
+ When I play the audio with a playback speed of 1.75x
77
+ Then the audio should play at 1.75x speed
78
+ When I play the audio with a playback speed of 0.5x
79
+ Then the audio should play at 0.5x speed
80
+ When I play the audio with a playback speed of 1.5x
81
+ Then the audio should play at 1.5x speed
82
+ When I play the audio with a playback speed of 0.75x
83
+ Then the audio should play at 0.75x speed
84
+ When I play the audio with a playback speed of 1.25x
85
+ Then the audio should play at 1.25x speed
86
+ When I play the audio with a playback speed of 1x
87
+ Then the audio should play at 1x speed
@@ -35,3 +35,10 @@ end
35
35
  Then(/^I expect the tab order to be correct$/) do
36
36
  PageManager.current_page.verify_tab_order
37
37
  end
38
+
39
+
40
+ When(/^I click the (.*) navigation (?:tab|link)$/) do |page_name|
41
+ # find and navigate to the specified target page
42
+ target_page = PageManager.find_page(page_name)
43
+ target_page.navigate_to
44
+ end
@@ -0,0 +1,30 @@
1
+
2
+
3
+ When(/^I (.*) the (.*) media$/) do |action, media_type|
4
+ media_test_page.perform_action(media_type, action)
5
+ end
6
+
7
+
8
+ Then(/^the (.*) should be (.*)$/) do |media_type, state|
9
+ media_test_page.verify_media_state(media_type, state)
10
+ end
11
+
12
+
13
+ When(/^I play the (.*) with a playback speed of (.*)x$/) do |media_type, rate|
14
+ media_test_page.set_playback_rate(media_type, rate)
15
+ end
16
+
17
+
18
+ Then(/^the (.*) should play at (.*)x speed$/) do |media_type, rate|
19
+ media_test_page.verify_playback_rate(media_type, rate)
20
+ end
21
+
22
+
23
+ When(/^I set the volume of the (.*) to (.*)$/) do |media_type, volume|
24
+ media_test_page.set_volume(media_type, volume)
25
+ end
26
+
27
+
28
+ Then(/^the (.*) should have a volume of (.*)$/) do |media_type, volume|
29
+ media_test_page.verify_volume(media_type, volume)
30
+ end
@@ -5,13 +5,15 @@ require 'require_all'
5
5
  require 'simplecov'
6
6
  require 'testcentricity_web'
7
7
 
8
- SimpleCov.command_name "features #{ENV['WEB_BROWSER']}" + (ENV['TEST_ENV_NUMBER'] || '')
8
+ include TestCentricity
9
+
10
+ SimpleCov.command_name("features-#{ENV['WEB_BROWSER']}-#{ENV['SELENIUM']}" + (ENV['TEST_ENV_NUMBER'] || ''))
9
11
 
10
12
  # require_relative 'world_data'
11
13
  require_relative 'world_pages'
12
14
 
13
15
  # require_rel 'data'
14
- # require_rel 'sections'
16
+ require_rel 'sections'
15
17
  require_rel 'pages'
16
18
 
17
19
  $LOAD_PATH << './lib'
@@ -27,8 +29,9 @@ I18n.locale = ENV['LOCALE']
27
29
  Faker::Config.locale = ENV['LOCALE']
28
30
 
29
31
  # instantiate all data objects and target test environment
30
- # include WorldData
31
- # environs.find_environ(ENV['TEST_ENVIRONMENT'], :yaml)
32
+ include WorldData
33
+ ENV['DATA_SOURCE'] = 'yaml' unless ENV['DATA_SOURCE']
34
+ environs.find_environ(ENV['TEST_ENVIRONMENT'], ENV['DATA_SOURCE'].downcase.to_sym)
32
35
  # WorldData.instantiate_data_objects
33
36
 
34
37
  # instantiate all page objects
@@ -38,6 +41,10 @@ WorldPages.instantiate_page_objects
38
41
  # establish connection to WebDriver and target web browser
39
42
  Webdrivers.cache_time = 86_400
40
43
 
41
- options = { app_host: "file://#{File.dirname(__FILE__)}/../../test_site" }
42
- options = { app_host: "http://192.168.1.129"}
43
- TestCentricity::WebDriverConnect.initialize_web_driver(options)
44
+
45
+ url = if ENV['TEST_ENVIRONMENT'].downcase == 'local'
46
+ "file://#{File.dirname(__FILE__)}/../../test_site"
47
+ else
48
+ Environ.current.app_host
49
+ end
50
+ WebDriverConnect.initialize_web_driver(app_host: url)
@@ -0,0 +1,11 @@
1
+ # Page Object class definition for Base Test page
2
+
3
+ class BaseTestPage < TestCentricity::PageObject
4
+ # Base Test page UI elements
5
+ label :header_label, 'h2'
6
+ sections header_nav: NavHeader
7
+
8
+ def navigate_to
9
+ navigator
10
+ end
11
+ end
@@ -12,8 +12,8 @@ class BasicCSSTestPage < BasicTestPage
12
12
  number_field: 'input#number-field',
13
13
  color_picker: 'input#color-picker',
14
14
  comments_field: 'textarea#comments'
15
- range :slider, 'input#slider'
16
- filefield :upload_file, 'input#filename'
15
+ ranges slider: 'input#slider'
16
+ filefields upload_file: 'input#filename'
17
17
  checkboxes check_1: 'input#check1',
18
18
  check_2: 'input#check2',
19
19
  check_3: 'input#check3',
@@ -24,14 +24,16 @@ class BasicCSSTestPage < BasicTestPage
24
24
  radio_4: 'input#radio4'
25
25
  selectlists multi_select: 'select#multipleselect',
26
26
  drop_down_select: 'select#dropdown'
27
- table :static_table, 'table#table'
27
+ links link_1: 'a#link1',
28
+ link_2: 'a#link2',
29
+ link_3: 'a#link3'
30
+ tables static_table: 'table#table'
28
31
  images image_1: 'img#image1',
29
32
  image_2: 'img#image2',
30
33
  image_3: 'img#image3'
31
34
  buttons cancel_button: 'input#cancel',
32
35
  submit_button: 'input#submit'
33
- labels header_label: 'h1',
34
- username_label: "label[for='username']",
36
+ labels username_label: "label[for='username']",
35
37
  password_label: "label[for='password']",
36
38
  max_length_label: "label[for='maxlength']",
37
39
  read_only_label: "label[for='readonly']",
@@ -44,6 +46,7 @@ class BasicCSSTestPage < BasicTestPage
44
46
  radios_label: 'label#radios',
45
47
  multiselect_label: "label[for='multipleselect']",
46
48
  dropdown_label: "label[for='dropdown']",
49
+ link_label: 'label#links',
47
50
  table_label: "label[for='table']",
48
51
  images_label: 'label#images'
49
52
  end
@@ -1,8 +1,40 @@
1
1
  # Page Object class definition for Basic HTML Test page
2
2
 
3
- class BasicTestPage < TestCentricity::PageObject
3
+ class BasicTestPage < BaseTestPage
4
4
  trait(:page_url) { '/basic_test_page.html' }
5
+ trait(:navigator) { header_nav.open_form_page }
5
6
  trait(:tab_order) {
7
+ [
8
+ header_nav.form_link,
9
+ header_nav.media_link,
10
+ header_nav.indexed_sections_link,
11
+ header_nav.custom_controls_link,
12
+ username_field,
13
+ password_field,
14
+ max_length_field,
15
+ read_only_field,
16
+ number_field,
17
+ color_picker,
18
+ slider,
19
+ comments_field,
20
+ upload_file,
21
+ check_1,
22
+ check_2,
23
+ check_3,
24
+ radio_1,
25
+ [
26
+ radio_2,
27
+ radio_3
28
+ ],
29
+ multi_select,
30
+ drop_down_select,
31
+ link_1,
32
+ link_2,
33
+ cancel_button,
34
+ submit_button
35
+ ]
36
+ }
37
+ trait(:firefox_order) {
6
38
  [
7
39
  username_field,
8
40
  password_field,
@@ -112,6 +144,22 @@ class BasicTestPage < TestCentricity::PageObject
112
144
  options: ['Drop Down Item 1', 'Drop Down Item 2', 'Drop Down Item 3', 'Drop Down Item 4', 'Drop Down Item 5', 'Drop Down Item 6'],
113
145
  selected: 'Drop Down Item 1'
114
146
  },
147
+ link_label => { visible: true, caption: 'Links:' },
148
+ link_1 => {
149
+ visible: true,
150
+ href: { ends_with: 'media_page.html' },
151
+ caption: 'Open Media Page in same window/tab'
152
+ },
153
+ link_2 => {
154
+ visible: true,
155
+ href: { ends_with: 'media_page.html' },
156
+ caption: 'Open Media Page in a new window/tab'
157
+ },
158
+ link_3 => {
159
+ visible: true,
160
+ aria_disabled: true,
161
+ caption: 'Disabled Link'
162
+ },
115
163
  table_label => { visible: true, caption: 'Table:' },
116
164
  static_table => {
117
165
  visible: true,
@@ -149,22 +197,30 @@ class BasicTestPage < TestCentricity::PageObject
149
197
  end
150
198
 
151
199
  def form_data
152
- file_path = Environ.platform == :mobile ? nil : "#{Dir.pwd}/test_site/images/Wilder.jpg"
200
+ if Environ.platform == :mobile
201
+ file_path = nil
202
+ file_name = ''
203
+ color_value = '#000000'
204
+ else
205
+ file_path = "#{Dir.pwd}/test_site/images/Wilder.jpg"
206
+ file_name = 'Wilder.jpg'
207
+ color_value = Faker::Color.hex_color
208
+ end
153
209
  {
154
210
  username: Faker::Name.name,
155
211
  password: 'T0p_Sekrit',
156
212
  maxlength: Faker::Marketing.buzzwords,
157
213
  number: Faker::Number.between(from: 10, to: 1024),
158
- color: Faker::Color.hex_color,
159
- slider: 45,
214
+ color: color_value,
215
+ slider: 50,
160
216
  comments: Faker::Hipster.paragraph,
161
217
  filepath: file_path,
162
- filename: "Wilder.jpg",
218
+ filename: file_name,
163
219
  check1: true,
164
220
  check2: true,
165
221
  check3: false,
166
- radio1: true,
167
- radio2: false,
222
+ radio1: false,
223
+ radio2: true,
168
224
  radio3: false,
169
225
  multi_select: 'Selection Item 2',
170
226
  drop_select: 'Drop Down Item 5'
@@ -228,8 +284,11 @@ class BasicTestPage < TestCentricity::PageObject
228
284
  end
229
285
 
230
286
  def verify_tab_order
231
- order = if Environ.browser == :safari
287
+ order = case Environ.browser
288
+ when :safari
232
289
  safari_tab_order
290
+ when :firefox
291
+ firefox_order
233
292
  else
234
293
  tab_order
235
294
  end
@@ -12,8 +12,8 @@ class BasicXpathTestPage < BasicTestPage
12
12
  number_field: "//input[@id='number-field']",
13
13
  comments_field: "//textarea[@id='comments']",
14
14
  color_picker: "//input[@id='color-picker']"
15
- range :slider, "//input[@id='slider']"
16
- filefield :upload_file, "//input[@id='filename']"
15
+ ranges slider: "//input[@id='slider']"
16
+ filefields upload_file: "//input[@id='filename']"
17
17
  checkboxes check_1: "//input[@id='check1']",
18
18
  check_2: "//input[@id='check2']",
19
19
  check_3: "//input[@id='check3']",
@@ -24,13 +24,16 @@ class BasicXpathTestPage < BasicTestPage
24
24
  radio_4: "//input[@id='radio4']"
25
25
  selectlists multi_select: "//select[@id='multipleselect']",
26
26
  drop_down_select: "//select[@id='dropdown']"
27
- table :static_table, "//table[@id='table']"
27
+ links link_1: "//a[@id='link1']",
28
+ link_2: "//a[@id='link2']",
29
+ link_3: "//a[@id='link3']"
30
+ tables static_table: "//table[@id='table']"
28
31
  images image_1: "//img[@id='image1']",
29
32
  image_2: "//img[@id='image2']",
30
33
  image_3: "//img[@id='image3']"
31
34
  buttons cancel_button: "//input[@id='cancel']",
32
35
  submit_button: "//input[@id='submit']"
33
- labels header_label: '//h1',
36
+ labels header_label: '//h2',
34
37
  username_label: "//label[@for='username']",
35
38
  password_label: "//label[@for='password']",
36
39
  max_length_label: "//label[@for='maxlength']",
@@ -44,6 +47,7 @@ class BasicXpathTestPage < BasicTestPage
44
47
  radios_label: "//label[@id='radios']",
45
48
  multiselect_label: "//label[@for='multipleselect']",
46
49
  dropdown_label: "//label[@for='dropdown']",
50
+ link_label: "//label[@id='links']",
47
51
  table_label: "//label[@for='table']",
48
52
  images_label: "//label[@id='images']"
49
53
  end
@@ -0,0 +1,16 @@
1
+ # Page Object class definition for Custom Controls page with CSS locators
2
+
3
+ class CustomControlsPage < BaseTestPage
4
+ trait(:page_name) { 'Custom Controls' }
5
+ trait(:page_locator) { 'div.custom-controls-page-body' }
6
+ trait(:page_url) { '/custom_controls_page.html' }
7
+ trait(:navigator) { header_nav.open_custom_controls_page }
8
+
9
+ def verify_page_ui
10
+ ui = {
11
+ self => { exists: true, secure: false, title: 'Custom Controls Page' },
12
+ header_label => { visible: true, caption: 'Custom Controls Page' }
13
+ }
14
+ verify_ui_states(ui)
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # Page Object class definition for Indexed Sections page with CSS locators
2
+
3
+ class IndexedSectionsPage < BaseTestPage
4
+ trait(:page_name) { 'Indexed Sections' }
5
+ trait(:page_locator) { 'div.indexed-sections-page-body' }
6
+ trait(:page_url) { '/indexed_sections_page.html' }
7
+ trait(:navigator) { header_nav.open_indexed_sections_page }
8
+
9
+ def verify_page_ui
10
+ ui = {
11
+ self => { exists: true, secure: false, title: 'Indexed Sections Page' },
12
+ header_label => { visible: true, caption: 'Indexed Sections Page' }
13
+ }
14
+ verify_ui_states(ui)
15
+ end
16
+ end