testcentricity_web 3.1.7 → 3.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +18 -20
- data/README.md +22 -19
- data/lib/devices/devices.yml +14 -14
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/page_objects_helper.rb +2 -0
- data/lib/testcentricity_web/web_core/page_sections_helper.rb +2 -0
- data/lib/testcentricity_web/web_elements/link.rb +10 -0
- data/lib/testcentricity_web/web_elements/list.rb +2 -2
- data/lib/testcentricity_web/web_elements/select_list.rb +61 -11
- data/testcentricity_web.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee5ffc5b5c66d609117bd4b61b894eec784dbdf
|
4
|
+
data.tar.gz: 4a169b25e059859ad4b7a2f3d8bc420f3d990cab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45237a60fcae4bd870fd2e69273acde68a34d98eba1adef24078c3e829027f029f3204ed27808027657a1f32e6df752c73c46973d94c356de79816c4a4f9df14
|
7
|
+
data.tar.gz: ebd3a02cdb35c91ed5b7c4e8e2ee47c6b688f4a8f4eb9d18100017ec143ec76c504a6efb77c779adeafb1099d434a77b35dc1e506097ea5b47bd41efbd816e5f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [3.1.8] - 2019-05-08
|
6
|
+
|
7
|
+
### Added
|
8
|
+
* Added `Link.href` method.
|
9
|
+
* Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `href` property.
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
* Updated device profiles for iPhone 7 (iOS 12.2) with Mobile Firefox browser and iPad (iOS 12.2) with Mobile Firefox browser.
|
13
|
+
* Updated device profiles for iPhone 7 (iOS 12.2) with Mobile Edge browser and iPad (iOS 12.2) with Mobile Edge browser.
|
14
|
+
* Updated device profiles for iPhone 7 (iOS 12.2) with Mobile Chrome browser and iPad (iOS 12.2) with Mobile Chrome browser.
|
15
|
+
|
16
|
+
|
5
17
|
## [3.1.7] - 2019-02-01
|
6
18
|
|
7
19
|
### Added
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
testcentricity_web (3.1.
|
4
|
+
testcentricity_web (3.1.8)
|
5
5
|
appium_lib
|
6
6
|
browserstack-local
|
7
7
|
capybara (>= 3.1, < 4)
|
@@ -21,11 +21,11 @@ GEM
|
|
21
21
|
specs:
|
22
22
|
addressable (2.6.0)
|
23
23
|
public_suffix (>= 2.0.2, < 4.0)
|
24
|
-
appium_lib (
|
25
|
-
appium_lib_core (~>
|
24
|
+
appium_lib (10.3.1)
|
25
|
+
appium_lib_core (~> 3.1)
|
26
26
|
nokogiri (~> 1.8, >= 1.8.1)
|
27
27
|
tomlrb (~> 1.1)
|
28
|
-
appium_lib_core (
|
28
|
+
appium_lib_core (3.1.1)
|
29
29
|
faye-websocket (~> 0.10.0)
|
30
30
|
selenium-webdriver (~> 3.14, >= 3.14.1)
|
31
31
|
axiom-types (0.1.1)
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
ice_nine (~> 0.11.0)
|
34
34
|
thread_safe (~> 0.3, >= 0.3.1)
|
35
35
|
browserstack-local (1.3.0)
|
36
|
-
capybara (3.
|
36
|
+
capybara (3.18.0)
|
37
37
|
addressable
|
38
38
|
mini_mime (>= 0.1.3)
|
39
39
|
nokogiri (~> 1.8)
|
@@ -46,42 +46,41 @@ GEM
|
|
46
46
|
chronic (0.10.2)
|
47
47
|
coercible (1.0.0)
|
48
48
|
descendants_tracker (~> 0.0.1)
|
49
|
-
concurrent-ruby (1.1.
|
49
|
+
concurrent-ruby (1.1.5)
|
50
50
|
descendants_tracker (0.0.4)
|
51
51
|
thread_safe (~> 0.3, >= 0.3.1)
|
52
52
|
equalizer (0.0.11)
|
53
53
|
eventmachine (1.2.7)
|
54
|
-
faker (1.9.
|
54
|
+
faker (1.9.3)
|
55
55
|
i18n (>= 0.7)
|
56
56
|
faye-websocket (0.10.7)
|
57
57
|
eventmachine (>= 0.12.0)
|
58
58
|
websocket-driver (>= 0.5.1)
|
59
59
|
ffi (1.10.0)
|
60
|
-
i18n (1.
|
60
|
+
i18n (1.6.0)
|
61
61
|
concurrent-ruby (~> 1.0)
|
62
62
|
ice_nine (0.11.2)
|
63
63
|
mini_mime (1.0.1)
|
64
64
|
mini_portile2 (2.4.0)
|
65
|
-
|
66
|
-
nokogiri (1.10.1)
|
65
|
+
nokogiri (1.10.3)
|
67
66
|
mini_portile2 (~> 2.4.0)
|
68
|
-
os (1.0.
|
69
|
-
power_assert (1.1.
|
67
|
+
os (1.0.1)
|
68
|
+
power_assert (1.1.4)
|
70
69
|
public_suffix (3.0.3)
|
71
|
-
rack (2.0.
|
70
|
+
rack (2.0.7)
|
72
71
|
rack-test (1.1.0)
|
73
72
|
rack (>= 1.0, < 3)
|
74
73
|
rake (12.3.2)
|
75
74
|
redcarpet (3.4.0)
|
76
|
-
regexp_parser (1.
|
77
|
-
ruby-ole (1.2.12.
|
75
|
+
regexp_parser (1.4.0)
|
76
|
+
ruby-ole (1.2.12.2)
|
78
77
|
rubyzip (1.2.2)
|
79
|
-
selenium-webdriver (3.
|
80
|
-
childprocess (
|
78
|
+
selenium-webdriver (3.142.1)
|
79
|
+
childprocess (>= 0.5, < 2.0)
|
81
80
|
rubyzip (~> 1.2, >= 1.2.2)
|
82
81
|
spreadsheet (1.1.7)
|
83
82
|
ruby-ole (>= 1.0)
|
84
|
-
test-unit (3.3.
|
83
|
+
test-unit (3.3.2)
|
85
84
|
power_assert
|
86
85
|
thread_safe (0.3.6)
|
87
86
|
tomlrb (1.2.8)
|
@@ -90,8 +89,7 @@ GEM
|
|
90
89
|
coercible (~> 1.0)
|
91
90
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
92
91
|
equalizer (~> 0.0, >= 0.0.9)
|
93
|
-
webdrivers (3.
|
94
|
-
net_http_ssl_fix
|
92
|
+
webdrivers (3.9.0)
|
95
93
|
nokogiri (~> 1.6)
|
96
94
|
rubyzip (~> 1.0)
|
97
95
|
selenium-webdriver (~> 3.0)
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ Or install it yourself as:
|
|
44
44
|
|
45
45
|
|
46
46
|
## Setup
|
47
|
-
###Using Cucumber
|
47
|
+
### Using Cucumber
|
48
48
|
|
49
49
|
If you are using Cucumber, you need to require the following in your *env.rb* file:
|
50
50
|
|
@@ -53,7 +53,7 @@ If you are using Cucumber, you need to require the following in your *env.rb* fi
|
|
53
53
|
require 'testcentricity_web'
|
54
54
|
|
55
55
|
|
56
|
-
###Using RSpec
|
56
|
+
### Using RSpec
|
57
57
|
|
58
58
|
If you are using RSpec instead, you need to require the following in your *env.rb* file:
|
59
59
|
|
@@ -87,9 +87,9 @@ implementation details of a web page and expose an API that supports interaction
|
|
87
87
|
|
88
88
|
**Page Objects** makes it easier to maintain automated tests because changes to page UI elements are updated in only one location - in the
|
89
89
|
**Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature files and step definitions are no longer required to
|
90
|
-
hold specific information about a page's UI objects, thus minimizing maintenance requirements. If any element on a page changes
|
91
|
-
text field attributes, button captions, etc.), maintenance is performed in the **Page Object** class definition only, typically with
|
92
|
-
to update the affected feature file, scenarios, or step definitions.
|
90
|
+
hold specific information about a page's UI objects, thus minimizing maintenance requirements. If any element on, or property of a page changes
|
91
|
+
(URL path, text field attributes, button captions, etc.), maintenance is performed in the **Page Object** class definition only, typically with
|
92
|
+
no need to update the affected feature file, scenarios, or step definitions.
|
93
93
|
|
94
94
|
|
95
95
|
### Defining a Page Object
|
@@ -223,6 +223,7 @@ the UI to hide implementation details, as shown below:
|
|
223
223
|
login_button.click
|
224
224
|
end
|
225
225
|
|
226
|
+
# set the state of the Remember Me checkbox
|
226
227
|
def remember_me(state)
|
227
228
|
remember_checkbox.set_checkbox_state(state)
|
228
229
|
end
|
@@ -230,6 +231,7 @@ the UI to hide implementation details, as shown below:
|
|
230
231
|
# verify Login page default UI state
|
231
232
|
def verify_page_ui
|
232
233
|
ui = {
|
234
|
+
self => { title: 'Login' },
|
233
235
|
login_button => { visible: true, caption: 'LOGIN' },
|
234
236
|
user_id_field => { visible: true, enabled: true },
|
235
237
|
password_field => { visible: true, enabled: true, value: '', placeholder: 'Password' },
|
@@ -261,7 +263,8 @@ the UI to hide implementation details, as shown below:
|
|
261
263
|
gender_select: 'select#gender',
|
262
264
|
state_select: 'select#stateProvince'
|
263
265
|
checkbox :email_opt_in_check, 'input#marketingEmailsOptIn'
|
264
|
-
|
266
|
+
buttons sign_up_button: 'button#registrationSignUp',
|
267
|
+
cancel_button: 'button#registrationCancel'
|
265
268
|
|
266
269
|
# populate Registration page fields with profile data
|
267
270
|
def enter_profile_data(profile)
|
@@ -771,12 +774,12 @@ the `WEB_BROWSER` Environment Variable must be set to one of the values from the
|
|
771
774
|
----------------------|----------------------|-----------|----------|---------
|
772
775
|
`ipad` |`chrome` |1024 x 768 |landscape |iOS 12
|
773
776
|
`ipad_pro` |`chrome` |1366 x 1024 |landscape |iOS 12
|
774
|
-
`ipad_pro_10_5` |`chrome` |1112 x 834 |landscape |iOS 12
|
775
|
-
`ipad_pro_11` |`chrome` |1194 x 834 |landscape |iOS 12.
|
776
|
-
`ipad_pro_12_9` |`chrome` |1366 x 1024 |landscape |iOS 12.
|
777
|
-
`ipad_chrome` |`chrome` |1024 x 768 |landscape |iOS 12.
|
778
|
-
`ipad_firefox` |`chrome` |1024 x 768 |landscape |iOS 12.
|
779
|
-
`ipad_edge` |`chrome` |1024 x 768 |landscape |iOS 12.
|
777
|
+
`ipad_pro_10_5` |`chrome` |1112 x 834 |landscape |iOS 12.2
|
778
|
+
`ipad_pro_11` |`chrome` |1194 x 834 |landscape |iOS 12.2
|
779
|
+
`ipad_pro_12_9` |`chrome` |1366 x 1024 |landscape |iOS 12.2
|
780
|
+
`ipad_chrome` |`chrome` |1024 x 768 |landscape |iOS 12.2 - Mobile Chrome browser for iOS
|
781
|
+
`ipad_firefox` |`chrome` |1024 x 768 |landscape |iOS 12.2 - Mobile Firefox browser for iOS
|
782
|
+
`ipad_edge` |`chrome` |1024 x 768 |landscape |iOS 12.2 - Mobile Edge browser for iOS
|
780
783
|
`android_tablet` |`chrome` |1024 x 768 |landscape |Android 3.0
|
781
784
|
`kindle_fire` |`chrome` |1024 x 600 |landscape |
|
782
785
|
`kindle_firehd7` |`chrome` |800 x 480 |landscape |Fire OS 3
|
@@ -792,15 +795,15 @@ the `WEB_BROWSER` Environment Variable must be set to one of the values from the
|
|
792
795
|
`iphone6_plus` |`chrome` |414 x 736 |portrait |iOS 12
|
793
796
|
`iphone7` |`chrome` |375 x 667 |portrait |iOS 12
|
794
797
|
`iphone7_plus` |`chrome` |414 x 736 |portrait |iOS 12
|
795
|
-
`iphone7_chrome` |`chrome` |375 x 667 |portrait |iOS 12.
|
796
|
-
`iphone7_firefox` |`chrome` |375 x 667 |portrait |iOS 12.
|
797
|
-
`iphone7_edge` |`chrome` |375 x 667 |portrait |iOS 12.
|
798
|
+
`iphone7_chrome` |`chrome` |375 x 667 |portrait |iOS 12.2 - Mobile Chrome browser for iOS
|
799
|
+
`iphone7_firefox` |`chrome` |375 x 667 |portrait |iOS 12.2 - Mobile Firefox browser for iOS
|
800
|
+
`iphone7_edge` |`chrome` |375 x 667 |portrait |iOS 12.2 - Microsoft Edge browser for iOS
|
798
801
|
`iphone8` |`chrome` |375 x 667 |portrait |iOS 12
|
799
802
|
`iphone8_plus` |`chrome` |414 x 736 |portrait |iOS 12
|
800
|
-
`iphone_x` |`chrome` |375 x 812 |portrait |iOS 12.
|
801
|
-
`iphone_xr` |`chrome` |414 x 896 |portrait |iOS 12.
|
802
|
-
`iphone_xs` |`chrome` |375 x 812 |portrait |iOS 12.
|
803
|
-
`iphone_xs_max` |`chrome` |414 x 896 |portrait |iOS 12.
|
803
|
+
`iphone_x` |`chrome` |375 x 812 |portrait |iOS 12.2
|
804
|
+
`iphone_xr` |`chrome` |414 x 896 |portrait |iOS 12.2
|
805
|
+
`iphone_xs` |`chrome` |375 x 812 |portrait |iOS 12.2
|
806
|
+
`iphone_xs_max` |`chrome` |414 x 896 |portrait |iOS 12.2
|
804
807
|
`android_phone` |`chrome` |360 x 640 |portrait |Android 4.2.1
|
805
808
|
`nexus6` |`chrome` |411 x 731 |portrait |Android 6
|
806
809
|
`pixel` |`chrome` |411 x 731 |portrait |Android 8
|
data/lib/devices/devices.yml
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
:css_width: 375
|
38
38
|
:css_height: 667
|
39
39
|
:default_orientation: portrait
|
40
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
40
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/73.0.3683.68 Mobile/15E148 Safari/605.1"
|
41
41
|
:iphone7_firefox:
|
42
42
|
:name: "iPhone 7 - Firefox"
|
43
43
|
:os: ios
|
@@ -45,7 +45,7 @@
|
|
45
45
|
:css_width: 375
|
46
46
|
:css_height: 667
|
47
47
|
:default_orientation: portrait
|
48
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
48
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/16.0b14732 Mobile/15E148 Safari/605.1.15"
|
49
49
|
:iphone7_edge:
|
50
50
|
:name: "iPhone 7 - MS Edge"
|
51
51
|
:os: ios
|
@@ -53,7 +53,7 @@
|
|
53
53
|
:css_width: 375
|
54
54
|
:css_height: 667
|
55
55
|
:default_orientation: portrait
|
56
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
56
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.2.1 Mobile/15E148 Safari/605.1.15"
|
57
57
|
:iphone8:
|
58
58
|
:name: "iPhone 8"
|
59
59
|
:os: ios
|
@@ -77,7 +77,7 @@
|
|
77
77
|
:css_width: 375
|
78
78
|
:css_height: 812
|
79
79
|
:default_orientation: portrait
|
80
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
80
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
81
81
|
:iphone_x:
|
82
82
|
:name: "iPhone X"
|
83
83
|
:os: ios
|
@@ -85,7 +85,7 @@
|
|
85
85
|
:css_width: 375
|
86
86
|
:css_height: 812
|
87
87
|
:default_orientation: portrait
|
88
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
88
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
89
89
|
:iphone_xr:
|
90
90
|
:name: "iPhone XR"
|
91
91
|
:os: ios
|
@@ -93,7 +93,7 @@
|
|
93
93
|
:css_width: 414
|
94
94
|
:css_height: 869
|
95
95
|
:default_orientation: portrait
|
96
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
96
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
97
97
|
:iphone_xs:
|
98
98
|
:name: "iPhone XS"
|
99
99
|
:os: ios
|
@@ -101,7 +101,7 @@
|
|
101
101
|
:css_width: 375
|
102
102
|
:css_height: 812
|
103
103
|
:default_orientation: portrait
|
104
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
104
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
105
105
|
:iphone_xs_max:
|
106
106
|
:name: "iPhone XS Max"
|
107
107
|
:os: ios
|
@@ -109,7 +109,7 @@
|
|
109
109
|
:css_width: 414
|
110
110
|
:css_height: 869
|
111
111
|
:default_orientation: portrait
|
112
|
-
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS
|
112
|
+
:user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
113
113
|
:android_phone:
|
114
114
|
:name: "Generic Android phone"
|
115
115
|
:os: android
|
@@ -237,7 +237,7 @@ nexus6:
|
|
237
237
|
:css_width: 1112
|
238
238
|
:css_height: 834
|
239
239
|
:default_orientation: landscape
|
240
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
240
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
241
241
|
:ipad_pro_11:
|
242
242
|
:name: "iPad Pro 11 in."
|
243
243
|
:os: ios
|
@@ -245,7 +245,7 @@ nexus6:
|
|
245
245
|
:css_width: 1194
|
246
246
|
:css_height: 834
|
247
247
|
:default_orientation: landscape
|
248
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
248
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
249
249
|
:ipad_pro_12_9:
|
250
250
|
:name: "iPad Pro 12.9 in. (3rd generation)"
|
251
251
|
:os: ios
|
@@ -253,7 +253,7 @@ nexus6:
|
|
253
253
|
:css_width: 1366
|
254
254
|
:css_height: 1024
|
255
255
|
:default_orientation: landscape
|
256
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
256
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1"
|
257
257
|
:ipad_chrome:
|
258
258
|
:name: "iPad - Chrome"
|
259
259
|
:os: ios
|
@@ -261,7 +261,7 @@ nexus6:
|
|
261
261
|
:css_width: 1024
|
262
262
|
:css_height: 768
|
263
263
|
:default_orientation: landscape
|
264
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
264
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/73.0.3683.68 Mobile/15E148 Safari/605.1"
|
265
265
|
:ipad_firefox:
|
266
266
|
:name: "iPad - Firefox"
|
267
267
|
:os: ios
|
@@ -269,7 +269,7 @@ nexus6:
|
|
269
269
|
:css_width: 1024
|
270
270
|
:css_height: 768
|
271
271
|
:default_orientation: landscape
|
272
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
272
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/16.0b14732 Mobile/15E148 Safari/605.1.15"
|
273
273
|
:ipad_edge:
|
274
274
|
:name: "iPad - MS Edge"
|
275
275
|
:os: ios
|
@@ -277,7 +277,7 @@ nexus6:
|
|
277
277
|
:css_width: 1024
|
278
278
|
:css_height: 768
|
279
279
|
:default_orientation: landscape
|
280
|
-
:user_agent: "Mozilla/5.0 (iPad; CPU OS
|
280
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.2.1 Mobile/15E148 Safari/605.1.15"
|
281
281
|
:android_tablet:
|
282
282
|
:name: "Generic Android tablet"
|
283
283
|
:os: android
|
@@ -4,15 +4,17 @@ module TestCentricity
|
|
4
4
|
attr_accessor :selected_item
|
5
5
|
attr_accessor :list_trigger
|
6
6
|
attr_accessor :text_field
|
7
|
+
attr_accessor :options_list
|
7
8
|
|
8
9
|
def initialize(name, parent, locator, context)
|
9
10
|
super
|
10
11
|
@type = :selectlist
|
11
12
|
list_spec = {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
selected_item: "li[class*='result-selected']",
|
14
|
+
list_item: "li[class*='active-result']",
|
15
|
+
list_trigger: nil,
|
16
|
+
text_field: nil,
|
17
|
+
options_list: nil
|
16
18
|
}
|
17
19
|
define_list_elements(list_spec)
|
18
20
|
end
|
@@ -28,6 +30,8 @@ module TestCentricity
|
|
28
30
|
@list_trigger = value
|
29
31
|
when :text_field
|
30
32
|
@text_field = value
|
33
|
+
when :options_list
|
34
|
+
@options_list = value
|
31
35
|
else
|
32
36
|
raise "#{element} is not a recognized selectlist element"
|
33
37
|
end
|
@@ -50,13 +54,39 @@ module TestCentricity
|
|
50
54
|
def choose_option(option)
|
51
55
|
obj, = find_element
|
52
56
|
object_not_found_exception(obj, nil)
|
57
|
+
|
58
|
+
unless @list_trigger.nil? && @options_list.nil?
|
59
|
+
obj.find(:css, @list_trigger).click
|
60
|
+
menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
|
61
|
+
object_not_found_exception(menu, nil)
|
62
|
+
raise "Could not find option #{option} to choose" unless first(:css, @list_item, minimum: 0, wait: 2)
|
63
|
+
|
64
|
+
if option.is_a?(Array)
|
65
|
+
option.each do |item|
|
66
|
+
page.find(:css, @list_item, text: item.strip).click
|
67
|
+
end
|
68
|
+
else
|
69
|
+
if option.is_a?(Hash)
|
70
|
+
page.find(:css, "#{@list_item}:nth-of-type(#{option[:index]})").click if option.key?(:index)
|
71
|
+
page.find(:css, "#{@list_item}:nth-of-type(#{option[:value]})").click if option.key?(:value)
|
72
|
+
page.find(:css, "#{@list_item}:nth-of-type(#{option[:text]})").click if option.key?(:text)
|
73
|
+
else
|
74
|
+
options = obj.all(@list_item).collect(&:text)
|
75
|
+
sleep(2) unless options.include?(option)
|
76
|
+
first(:css, @list_item, text: option).click
|
77
|
+
end
|
78
|
+
end
|
79
|
+
return
|
80
|
+
end
|
81
|
+
|
53
82
|
if @list_trigger.nil?
|
54
83
|
obj.click
|
55
84
|
else
|
56
85
|
page.find(:css, @list_trigger).click
|
57
86
|
sleep(1)
|
58
87
|
end
|
59
|
-
|
88
|
+
|
89
|
+
if first(:css, @list_item, minimum: 0, wait: 2)
|
60
90
|
if option.is_a?(Array)
|
61
91
|
option.each do |item|
|
62
92
|
page.find(:css, @list_item, text: item.strip).click
|
@@ -107,10 +137,19 @@ module TestCentricity
|
|
107
137
|
def get_options
|
108
138
|
obj, = find_element
|
109
139
|
object_not_found_exception(obj, nil)
|
110
|
-
if
|
111
|
-
obj.
|
140
|
+
if @list_trigger.nil? && @options_list.nil?
|
141
|
+
if obj.first(:css, @list_item, minimum: 0, wait: 2)
|
142
|
+
obj.all(@list_item).collect(&:text)
|
143
|
+
else
|
144
|
+
obj.all('option', visible: :all).collect(&:text)
|
145
|
+
end
|
112
146
|
else
|
113
|
-
obj.
|
147
|
+
obj.find(:css, @list_trigger).click
|
148
|
+
menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
|
149
|
+
object_not_found_exception(menu, nil)
|
150
|
+
options = menu.all(@list_item, visible: true, minimum: 0, wait: 2).collect(&:text)
|
151
|
+
obj.find(:css, @list_trigger).click
|
152
|
+
options
|
114
153
|
end
|
115
154
|
end
|
116
155
|
|
@@ -126,10 +165,19 @@ module TestCentricity
|
|
126
165
|
def get_option_count
|
127
166
|
obj, = find_element
|
128
167
|
object_not_found_exception(obj, nil)
|
129
|
-
if
|
130
|
-
obj.
|
168
|
+
if @list_trigger.nil? && @options_list.nil?
|
169
|
+
if obj.first(:css, @list_item, minimum: 0, wait: 2)
|
170
|
+
obj.all(@list_item).count
|
171
|
+
else
|
172
|
+
obj.all('option', visible: :all).count
|
173
|
+
end
|
131
174
|
else
|
132
|
-
obj.
|
175
|
+
obj.find(:css, @list_trigger).click
|
176
|
+
menu = obj.find(:css, @options_list, minimum: 0, wait: 2)
|
177
|
+
object_not_found_exception(menu, nil)
|
178
|
+
num_items = menu.all(@list_item, visible: true, minimum: 0, wait: 2).count
|
179
|
+
obj.find(:css, @list_trigger).click
|
180
|
+
num_items
|
133
181
|
end
|
134
182
|
end
|
135
183
|
|
@@ -156,6 +204,8 @@ module TestCentricity
|
|
156
204
|
object_not_found_exception(obj, nil)
|
157
205
|
if obj.first(:css, @list_item, minimum: 0)
|
158
206
|
obj.first(:css, @selected_item).text
|
207
|
+
elsif obj.first(:css, @selected_item, minimum: 0)
|
208
|
+
obj.first(:css, @selected_item).text
|
159
209
|
else
|
160
210
|
obj.first('option[selected]', visible: :all).text
|
161
211
|
end
|
data/testcentricity_web.gemspec
CHANGED
@@ -10,15 +10,15 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.required_ruby_version = '>= 2.3.0'
|
11
11
|
spec.authors = ['A.J. Mrozinski']
|
12
12
|
spec.email = ['testcentricity@gmail.com']
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
13
|
+
spec.summary = 'A Page Object and Data Object Model Framework for desktop and mobile web testing'
|
14
|
+
spec.description = '
|
15
15
|
The TestCentricity™ Web core generic framework for desktop and mobile web browser-based applications testing implements
|
16
16
|
a Page Object Model DSL for use with Cucumber, Capybara, and Selenium-Webdriver. The gem provides support for running
|
17
17
|
automated tests against locally hosted desktop browsers, locally hosted emulated mobile browsers (iOS, Android, Windows
|
18
18
|
Phone, Blackberry, Kindle Fire) running within a local instance of Chrome, mobile Safari browsers on iOS device simulators
|
19
19
|
or physical iOS devices (using Appium and XCode on OS X), mobile Chrome or Android browsers on Android Studio virtual
|
20
20
|
device emulators (using Appium and Android Studio on OS X), or cloud hosted desktop or mobile web browsers (using the
|
21
|
-
BrowserStack, Sauce Labs, CrossBrowserTesting, TestingBot, or Gridlastic services).
|
21
|
+
BrowserStack, Sauce Labs, CrossBrowserTesting, TestingBot, or Gridlastic services).'
|
22
22
|
spec.homepage = ''
|
23
23
|
spec.license = 'BSD-3-Clause'
|
24
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|