testcentricity_web 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75c1e711abee33a40b8824e4e1c49d9f08802f49
4
- data.tar.gz: 384be28bacdc6861daacdc08cc9a43188c03a428
3
+ metadata.gz: 258399cf7a4c2ad149538baca9fa69094f38449e
4
+ data.tar.gz: b94b98ce6a4201ef55070e6be807025240c16081
5
5
  SHA512:
6
- metadata.gz: e9c50e28867b62bc65088ba285297d43d06a22571061517c34ddbdeea1a25904d5363649303254b7e284bcf1553173b80e93d781543679e56a258346a180f2b7
7
- data.tar.gz: 9ad61cdac26f2d4c5a99c07b0a7d8b949abb735a267b069fe061e9a7f647675cb9fe579f2f606e196318685b0b818791e6ad23f22445454df95522fc4dd30d5d
6
+ metadata.gz: 1d5494b53c342db2401efb2da4d34887c11ec1e0f614b339dbfc9ef8fe974a3731ec54fc50a9924052d1fdab280981aca9b6b7883816843b3b4670b78ca6528a
7
+ data.tar.gz: e598693e32cddfa5004b18fbf08f1de60dd8156d4dfdd11408ca9555245ba5033560e1499494f5629f7f0e098d76b268f62e8c7a02f550a48b2084f5b7449df1
data/.yardopts CHANGED
@@ -1,2 +1,3 @@
1
1
  --markup markdown
2
- --markup-provider redcarpet
2
+ --markup-provider redcarpet
3
+ --no-private - README.md HISTORY.md LICENSE.md
data/HISTORY.md CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ ###Version 3.0.2
3
+
4
+ * `PageManager.find_page` method now raises an exception if the requested page object has not been defined and instantiated.
5
+
2
6
  ###Version 3.0.1
3
7
 
4
8
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
data/README.md CHANGED
@@ -11,7 +11,7 @@ An example project that demonstrates the implementation of a page object model f
11
11
  The TestCentricity™ Web gem supports running automated tests against the following web test targets:
12
12
  * locally hosted desktop browsers (Firefox, Chrome, Safari, or IE)
13
13
  * locally hosted emulated iOS Mobile Safari, Android, Windows Phone, or Blackberry mobile browsers (running within a local instance of Chrome)
14
- * locally hosted headless Chrome or Firefox browsers
14
+ * locally hosted "headless" Chrome or Firefox browsers
15
15
  * mobile Safari browsers on iOS device simulators or physical iOS devices (using Appium and XCode on OS X)
16
16
  * mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on OS X)
17
17
  * cloud hosted desktop (Firefox, Chrome, Safari, IE, or Edge) or mobile (iOS Mobile Safari or Android) web browsers using the [Browserstack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate),
@@ -22,6 +22,13 @@ The TestCentricity™ Web gem supports running automated tests against the follo
22
22
 
23
23
 
24
24
  ## What's New
25
+
26
+ A complete history of bug fixes and new features can be found in the {file:docs/HISTORY.html HISTORY} file.
27
+
28
+ ###Version 3.0.2
29
+
30
+ * `PageManager.find_page` method now raises an exception if the requested page object has not been defined and instantiated.
31
+
25
32
  ###Version 3.0.1
26
33
 
27
34
  * Updated device profiles for iPhone 7 (iOS 11) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
@@ -38,202 +45,6 @@ versions of Firefox web browsers.
38
45
  * `TestCentricity::WebDriverConnect.set_webdriver_path` method now sets the path to the appropriate **geckodriver** file for OS X or Windows when testing on
39
46
  locally hosted Firefox browsers.
40
47
 
41
- ###Version 2.4.3
42
-
43
- * Updated device profiles for iPhone 7 (iOS 11) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
44
-
45
- ###Version 2.4.1
46
-
47
- * Added device profiles for iPad (iOS 10) with MS Edge browser.
48
-
49
- ###Version 2.4.0
50
-
51
- * Updated `TestCentricity::WebDriverConnect.initialize_web_driver` method to read the `APP_FULL_RESET`, `APP_NO_RESET`, and `NEW_COMMAND_TIMEOUT` Environment
52
- Variables and set the corresponding `fullReset`, `noReset`, and `newCommandTimeout` Appium capabilities for iOS and Android physical devices and simulators.
53
- Also reads the `WDA_LOCAL_PORT` Environment Variable and sets the `wdaLocalPort` Appium capability for iOS physical devices only.
54
-
55
- ###Version 2.3.18
56
-
57
- * Updated `SelectList.define_list_elements` method to accept value for `:list_trigger` element.
58
- * Updated `SelectList.choose_option` to respect `:list_item` value and to click on `:list_trigger` element, if one is specified.
59
- * Updated `PageSection` and `PageObject` UI element object declaration methods to no longer use `class_eval` pattern.
60
- * Updated device profiles for iPhone 7 (iOS 10) with Chrome browser and iPad (iOS 10) with Chrome browser.
61
-
62
- ###Version 2.3.17
63
-
64
- * Added `List.wait_until_item_count_is` and `List.wait_until_item_count_changes` methods.
65
- * `UIElement.wait_until_value_is` and `List.wait_until_item_count_is` methods now accept comparison hash.
66
-
67
- ###Version 2.3.16
68
-
69
- * Added `PageSection.double_click`, `PageObject.right_click`, and `PageObject.send_keys` methods.
70
-
71
- ###Version 2.3.15
72
-
73
- * Added `PageObject.wait_until_exists` and `PageObject.wait_until_gone` methods.
74
-
75
- ###Version 2.3.14
76
-
77
- * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser.
78
-
79
- ###Version 2.3.13
80
-
81
- * Added `AppiumServer.start`, `AppiumServer.running?`, and `AppiumServer.stop` methods for starting and stopping the Appium Server prior to executing tests on
82
- iOS physical devices or simulators, or Android virtual device emulators.
83
-
84
- ###Version 2.3.12
85
-
86
- * Added `Environ.is_simulator?` and `Environ.is_web?` methods.
87
-
88
- ###Version 2.3.11
89
-
90
- * Added support for running tests in Mobile Safari browser on physical iOS devices.
91
- * Updated device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
92
-
93
- ###Version 2.3.10
94
-
95
- * Added support for running tests in mobile Chrome or Android browsers on Android Studio virtual device emulators.
96
- * Added `displayed?`, `get_all_items_count`, and `get_all_list_items` methods to `PageSection` class.
97
- * Added `get_all_items_count`, and `get_all_list_items` methods to `List` class.
98
-
99
- ###Version 2.3.9
100
-
101
- * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to accept optional `wait_time` parameter.
102
- * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
103
- * Updated device profiles for iPad (iOS 10) with Chrome browser and iPad (iOS 10) with Firefox browser.
104
-
105
- ###Version 2.3.7
106
-
107
- * Added `width`, `height`, `x`, `y`, and `displayed?` methods to `UIElement` class.
108
-
109
- ###Version 2.3.6
110
-
111
- * Added `TextField.clear` method for deleting the contents of text fields. This method should trigger the `onchange` event for the associated text field.
112
-
113
- ###Version 2.3.5
114
-
115
- * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to be compatible with Redactor editor fields.
116
- * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser, iPhone 7 (iOS 10) with Chrome browser, and iPhone 7 (iOS 10) with Firefox browser.
117
-
118
- ###Version 2.3.3
119
-
120
- * Added device profile for iPhone 7 (iOS 10) with MS Edge browser.
121
-
122
- ###Version 2.3.1
123
-
124
- * When testing using remotely hosted browsers on the BrowserStack service, the BrowserStack Local instance is automatically started if the `TUNNELING`
125
- Environment Variable is set to `true`. `Environ.tunneling` will be set to true if the BrowserStack Local instance is succesfully started.
126
- * Added `TestCentricity::WebDriverConnect.close_tunnel` method to close BrowserStack Local instance when Local testing is enabled. Refer to the
127
- **Remotely hosted desktop and mobile web browsers** section for information on usage.
128
-
129
- ###Version 2.2.0
130
-
131
- * CSS selectors or XPath expressions may be used as locators for all types of **UI Elements**, including tables.
132
-
133
- ###Version 2.1.10
134
-
135
- * Added device profiles for iPhone 7 (iOS 10) with Mobile Firefox browser and iPad (iOS 10) with Mobile Firefox browser.
136
-
137
- ###Version 2.1.8
138
-
139
- * Added `PageSection.verify_list_items` method for **Indexed PageSection Objects**.
140
-
141
- ###Version 2.1.7
142
-
143
- * Updated `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods to use backspace characters to delete contents of a textfield
144
- instead of using `clear`, which was preventing `onchange` JavaScript events from being triggered in some browsers.
145
-
146
- ###Version 2.1.5
147
-
148
- * Added `get_min`, `get_max`, and `get_step` methods to `TextField` class.
149
-
150
- * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `min`, `max`, and `step` attributes
151
- for textfields.
152
-
153
- ###Version 2.1.4
154
-
155
- * Added suppression of the Info Bar that displays "Chrome is being controlled by automated test software" on locally hosted instances of the Chrome browser.
156
-
157
-
158
- ###Version 2.1.3
159
-
160
- * Added support for "tiling" or cascading multiple browser windows when the `BROWSER_TILE` and `PARALLEL` Environment Variables are set to true. For each
161
- concurrent parallel thread being executed, the position of each browser will be offset by 100 pixels right and 100 pixels down. For parallel test execution,
162
- use the [parallel_tests gem](https://rubygems.org/gems/parallel_tests) to decrease overall test execution time.
163
-
164
- ###Version 2.1.2
165
-
166
- * Added device profiles for Microsoft Lumia 950, Blackberry Leap, Blackberry Passport, and Kindle Fire HD 10
167
- * Added ability to set browser language support via the `LOCALE` Environment Variable for local instances of Chrome browsers
168
-
169
- ###Version 2.1.0
170
-
171
- * Added device profiles for iPhone 8, iPhone 8 Plus, iPhone X devices running iOS 11
172
- * Added device profile for iPad Pro 10.5" with iOS 11
173
- * Updated iPhone 7 and iPhone 7 Plus profiles to iOS 10
174
- * Updated Google Pixel and Google Pixel XL profiles to Android 8
175
- * Added device profiles for iPhone 7 (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Chrome browser
176
-
177
-
178
- ## What's Fixed
179
- ###Version 2.3.19
180
-
181
- * Fixed device profile for `android_phone` - Generic Android Phone.
182
-
183
- ###Version 2.3.18
184
-
185
- * Fixed `SelectList.choose_option` to also accept `:text`, `:value`, and `:index` option hashes across all types of select list objects.
186
-
187
- ###Version 2.3.15
188
-
189
- * Fixed bug in `UIElement.get_object_type` method that could result in a `NoMethodError obj not defined` error.
190
- * Fixed bug in `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods that failed to enqueue errors when UI elements could not be found.
191
-
192
- ###Version 2.3.8
193
-
194
- * Fixed locator resolution for **Indexed PageSection Objects**.
195
-
196
- ###Version 2.3.6.1
197
-
198
- * `TextField.clear` method now works with most `number` type fields.
199
-
200
- ###Version 2.3.4
201
-
202
- * Fixed bug in `PageObject.populate_data_fields` and `PageSection.populate_data_fields` methods that prevented deletion of data in number type textfields
203
- and textarea controls.
204
-
205
- ###Version 2.3.3
206
-
207
- * Corrected device profiles for iPad (iOS 10) with Mobile Chrome browser and iPad (iOS 10) with Mobile Firefox browser.
208
-
209
- ###Version 2.2.1
210
-
211
- * `SelectList.choose_option` method now accepts index values for Chosen list objects.
212
-
213
- ###Version 2.1.9
214
-
215
- * Fixed bug in `SelectList.choose_option`, `SelectList.get_options`, `SelectList.get_option_count`, and `SelectList.get_selected_option` methods which
216
- did not recognize grouped option in Chosen list objects.
217
-
218
- ###Version 2.1.6
219
-
220
- * Fixed bug in `TestCentricity::WebDriverConnect.set_webdriver_path` method that was failing to set the path to the appropriate **chromedriver** file for OS X
221
- and Windows.
222
-
223
- ###Version 2.1.5
224
-
225
- * Fixed Chrome and Firefox support for setting browser language via the `LOCALE` Environment Variable. This capability now works for emulated mobile
226
- browsers hosted in a local instance of Chrome or Firefox.
227
-
228
- ###Version 2.1.0
229
-
230
- * The `TestCentricity::WebDriverConnect.initialize_web_driver` method now sets the `Environ` object to the correct device connection states for local and
231
- cloud hosted browsers.
232
- * The `TestCentricity::WebDriverConnect.initialize_web_driver` method no longer calls `initialize_browser_size` when running tests against cloud hosted
233
- mobile web browser, which was resulting in Appium throwing exceptions for unsupported method calls.
234
- * The `TestCentricity::WebDriverConnect.set_webdriver_path` method now correctly sets the path for Chrome webDrivers when the `HOST_BROWSER` Environment
235
- Variable is set to `chrome`. Tests against locally hosted emulated mobile web browser running on a local instance of Chrome will now work correctly.
236
-
237
48
 
238
49
  ## Installation
239
50
 
@@ -496,7 +307,7 @@ the UI to hide implementation details, as shown below:
496
307
  Once your **Page Objects** have been instantiated, you can call your methods as shown below:
497
308
 
498
309
  login_page.remember_me(true)
499
- login_page.user_id_field.set('snicklefritz', 'Pa55w0rd')
310
+ login_page.login('snicklefritz', 'Pa55w0rd')
500
311
 
501
312
 
502
313
 
@@ -797,7 +608,7 @@ navigated to by clicking associated links. One such Cucumber navigation scenario
797
608
  |FAQs |
798
609
  |Contact Us |
799
610
 
800
- In the above example, the step definitions associated with the 3 steps might be implemented using a page_dispatcher method using a
611
+ In the above example, the step definitions associated with the 3 steps might be implemented using a `page_dispatcher` method using a
801
612
  `case` statement to parse the `page` parameter as in the example below:
802
613
 
803
614
  Given(/^I am on the ([^\"]*) page$/) do |page_name|
@@ -849,37 +660,24 @@ To use these **PageManager** methods, include the step definitions and code belo
849
660
  include TestCentricity
850
661
 
851
662
  Given(/^I am on the ([^\"]*) page$/) do |page_name|
852
- target_page = page_dispatcher(page_name)
853
- target_page.load_page if target_page
854
- # let PageManager store an instance of the current page object
855
- PageManager.current_page = target_page
663
+ target_page = PageManager.find_page(page_name)
664
+ target_page.load_page
856
665
  end
857
666
 
858
- When(/^I click the ([^\"]*) navigation link$/) do |link_name|
859
- target_page = page_dispatcher(link_name)
860
- target_page.navigate_to if target_page
667
+ When(/^I click the ([^\"]*) navigation link$/) do |page_name|
668
+ target_page = PageManager.find_page(page_name)
669
+ target_page.navigate_to
861
670
  end
862
671
 
863
672
  Then(/^I expect to see the ([^\"]*) page$/) do |page_name|
864
- target_page = page_dispatcher(page_name)
865
- target_page.verify_page_exists if target_page
866
- # let PageManager store an instance of the current page object
867
- PageManager.current_page = target_page
673
+ target_page = PageManager.find_page(page_name)
674
+ target_page.verify_page_exists
868
675
  end
869
676
 
870
677
  Then(/^I expect the ([^\"]*) page to be correctly displayed$/) do |page_name|
871
- target_page = page_dispatcher(page_name)
678
+ target_page = PageManager.find_page(page_name)
872
679
  target_page.verify_page_exists
873
680
  target_page.verify_page_ui
874
- # let PageManager store an instance of the current page object
875
- PageManager.current_page = target_page
876
- end
877
-
878
- # this method takes a page name as a parameter and returns an instance of the associated Page Object
879
- def page_dispatcher(page_name)
880
- page = PageManager.find_page(page_name)
881
- raise "No page object defined for page named '#{page_name}'" unless page
882
- page
883
681
  end
884
682
 
885
683
 
@@ -899,12 +697,16 @@ the connection.
899
697
  For locally hosted desktop web browsers running on macOS (OS X) or Windows platforms, the `WEB_BROWSER` Environment Variable must be set to one of the
900
698
  values from the table below:
901
699
 
902
- `WEB_BROWSER` | **Desktop Platform**
903
- --------------|----------------
904
- `firefox` | macOS (OS X) or Windows
905
- `chrome` | macOS (OS X) or Windows
906
- `safari` | macOS (OS X) only
907
- `ie` | Windows only
700
+ `WEB_BROWSER` | **Desktop Platform**
701
+ -------------------|----------------
702
+ `chrome` | OS X or Windows
703
+ `chrome_headless` | OS X or Windows (headless - no visible UI)
704
+ `firefox` | OS X or Windows (Firefox version 55 or greater only)
705
+ `firefox_headless` | OS X or Windows (headless - no visible UI)
706
+ `firefox_legacy` | OS X or Windows (Firefox version 47.0.1 only)
707
+ `safari` | OS X only
708
+ `ie` | Windows only (IE version 10.x or greater only)
709
+
908
710
 
909
711
  To set the size of a desktop browser window, you set the `BROWSER_SIZE` Environment Variable to the desired width and height in pixels as shown below:
910
712
 
@@ -979,7 +781,7 @@ to `chrome`.
979
781
 
980
782
  You can run your mobile web tests against the mobile Safari browser on simulated iOS devices or physically connected iOS devices using Appium and XCode on
981
783
  OS X. You must install Appium, XCode, and the iOS version-specific device simulators for XCode. You must also ensure that the `appium_capybara` gem is
982
- installed and required as described in **section 2.4 (Setup - Using Appium)** above.
784
+ installed and required as described in **section 3.3 (Setup - Using Appium)** above.
983
785
 
984
786
  Information about Appium setup and configuration requirements for testing on physically connected iOS devices can be found on [this page](https://github.com/appium/appium/blob/master/docs/en/drivers/ios-xcuitest-real-devices.md).
985
787
  The Appium server must be running prior to invoking Cucumber to run your features/scenarios.
@@ -1,5 +1,6 @@
1
1
  require 'capybara/cucumber'
2
2
  require 'test/unit'
3
+ require 'appium_lib'
3
4
 
4
5
  require 'testcentricity_web/version'
5
6
  require 'testcentricity_web/world_extensions'
@@ -77,7 +78,9 @@ module TestCentricity
77
78
 
78
79
  def self.find_page(page_name)
79
80
  (page_name.is_a? String) ? page_id = page_name.gsub(/\s+/, '').downcase.to_sym : page_id = page_name
80
- @page_objects[page_id]
81
+ page = @page_objects[page_id]
82
+ raise "No page object defined for page named '#{page_name}'" unless page
83
+ page
81
84
  end
82
85
 
83
86
  # Get the currently active PageObject
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  end
@@ -100,10 +100,7 @@ module TestCentricity
100
100
  send_keys(:backspace)
101
101
  end
102
102
  sleep(0.5)
103
- send_keys(:tab)
104
- sleep(0.5)
105
- length = get_value.length
106
- if length > 0
103
+ if get_value.length > 0
107
104
  set('')
108
105
  sleep(0.5)
109
106
  send_keys(:tab)
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency 'os'
41
41
  spec.add_dependency 'i18n'
42
42
  spec.add_dependency 'browserstack-local'
43
+ spec.add_dependency 'appium_lib'
43
44
 
44
45
  spec.add_runtime_dependency 'childprocess', '~> 0.5'
45
46
  end
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.0.1
4
+ version: 3.0.2
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: 2018-04-28 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: appium_lib
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: childprocess
169
183
  requirement: !ruby/object:Gem::Requirement