testcentricity_web 0.7.9 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -37
- data/lib/testcentricity_web/elements/checkbox.rb +2 -2
- data/lib/testcentricity_web/elements/radio.rb +2 -2
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/webdriver_helper.rb +11 -3
- data/testcentricity_web.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 413fc537c154be3f2dcf1b31d68f4e9b03de600b
|
4
|
+
data.tar.gz: 0ab45a3cc3c49aee5d327a93efccac581bb6e125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 838e99e3be15fda4e31b9635114292fe58c490d92dadb273b25c2c89cc41c0272509fdebf23fa0131e94f66a2bca7f2cd6f6c8a545569bc142f4a8942e3f09f2
|
7
|
+
data.tar.gz: 19100004c7508f79d8d36b4607613faf63562d0f3ad178d015f54a3d7b13e6c39ec4e5db8996f545803de5a02fb6055c95b4d89707eb88e9402e08c733f48af0
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
#
|
1
|
+
# TestCentricity™ Web
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/testcentricity_web.svg)](https://badge.fury.io/rb/testcentricity_web) [![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause)
|
4
4
|
|
5
5
|
|
6
|
-
The TestCentricity™ core generic framework for desktop and mobile web site testing implements a Page Object and Data Object Model DSL for
|
6
|
+
The TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object and Data Object Model DSL for
|
7
7
|
use with Cucumber, Capybara, and Selenium-Webdriver.
|
8
8
|
|
9
9
|
The TestCentricity™ Web gem supports running testing against the following web test targets:
|
10
10
|
|
11
11
|
* locally hosted desktop browsers (Firefox, Chrome, Safari, IE, or Edge)
|
12
|
-
* locally hosted emulated iOS, Android, and Windows Phone mobile browsers (using Firefox)
|
12
|
+
* locally hosted emulated iOS, Android, and Windows Phone mobile browsers (using Firefox or Chrome)
|
13
13
|
* a "headless" browser (using Poltergeist and PhantomJS)
|
14
14
|
* cloud hosted desktop or mobile web browsers using the BrowserStack, Sauce Labs, CrossBrowserTesting, or TestingBot services.
|
15
15
|
|
@@ -61,9 +61,9 @@ project's Gemfile:
|
|
61
61
|
|
62
62
|
The **Page Object Model** is a test automation pattern that aims to create an abstraction of your web app's User Interface that can be used
|
63
63
|
in tests. A **Page Object** is an object that represents a single page in your AUT (Application Under Test). **Page Objects** encapsulate the
|
64
|
-
implementation details of a web page and expose an API that supports interaction with, and validation of UI elements on the page.
|
64
|
+
implementation details of a web page and expose an API that supports interaction with, and validation of the UI elements on the page.
|
65
65
|
|
66
|
-
**Page Objects** makes it easier to maintain automated tests
|
66
|
+
**Page Objects** makes it easier to maintain automated tests because changes to page UI elements are updated in only one location - in the
|
67
67
|
**Page Object** class definition. By adopting a **Page Object Model**, Cucumber Feature files and step definitions are no longer required to
|
68
68
|
hold specific information about a page's UI objects, thus minimizing maintenance requirements. If any element on a page changes (URL path,
|
69
69
|
text field attributes, button captions, etc.), maintenance is performed in the **Page Object** class definition only, typically with no need
|
@@ -357,27 +357,30 @@ To maximize a desktop browser window, you set the `BROWSER_SIZE` Environment Var
|
|
357
357
|
|
358
358
|
### Locally hosted emulated mobile web browser
|
359
359
|
|
360
|
-
You can also run your tests against emulated mobile device browsers within a locally hosted instance of
|
361
|
-
mobile browser's user agent and default screen resolution and orientation will be automatically
|
362
|
-
may even specify the emulated device's screen orientation. For locally hosted emulated mobile web browsers, the `WEB_BROWSER` Environment
|
363
|
-
must be set to one of the values from the table below:
|
364
|
-
|
365
|
-
`WEB_BROWSER` |
|
366
|
-
---------------
|
367
|
-
`ipad`
|
368
|
-
`ipad_pro`
|
369
|
-
`iphone`
|
370
|
-
`iphone4`
|
371
|
-
`iphone5`
|
372
|
-
`iphone6`
|
373
|
-
`iphone6_plus`
|
374
|
-
`android_phone`
|
375
|
-
`android_tablet`
|
376
|
-
`windows_phone7`
|
377
|
-
`windows_phone8`
|
360
|
+
You can also run your tests against emulated mobile device browsers within a locally hosted instance of a Firefox (default) or Chrome desktop browser.
|
361
|
+
The specified mobile browser's user agent and default screen resolution and orientation will be automatically set in the local Firefox or Chrome browser
|
362
|
+
instance. You may even specify the emulated device's screen orientation. For locally hosted emulated mobile web browsers, the `WEB_BROWSER` Environment
|
363
|
+
Variable must be set to one of the values from the table below:
|
364
|
+
|
365
|
+
`WEB_BROWSER` | `HOST_BROWSER`
|
366
|
+
--------------- |------------
|
367
|
+
`ipad` |`firefox` (default) or `chrome`
|
368
|
+
`ipad_pro` |`firefox` (default) or `chrome`
|
369
|
+
`iphone` |`firefox` (default) or `chrome`
|
370
|
+
`iphone4` |`firefox` (default) or `chrome`
|
371
|
+
`iphone5` |`firefox` (default) or `chrome`
|
372
|
+
`iphone6` |`firefox` (default) or `chrome`
|
373
|
+
`iphone6_plus` |`firefox` (default) or `chrome`
|
374
|
+
`android_phone` |`firefox` (default) or `chrome`
|
375
|
+
`android_tablet` |`firefox` (default) or `chrome`
|
376
|
+
`windows_phone7` |`firefox` (default) or `chrome`
|
377
|
+
`windows_phone8` |`firefox` (default) or `chrome`
|
378
378
|
|
379
379
|
To specify the emulated device's screen orientation, you set the `ORIENTATION` Environment Variable to either `portrait` or `landscape`.
|
380
380
|
|
381
|
+
To use a local instance of the Chrome desktop browser to host the emulated mobile web browser, you must set the `HOST_BROWSER` Environment Variable
|
382
|
+
to `chrome`.
|
383
|
+
|
381
384
|
|
382
385
|
### Remotely hosted desktop and mobile web browsers
|
383
386
|
|
@@ -534,19 +537,20 @@ replace the placeholder text with your user account and authorization code for t
|
|
534
537
|
|
535
538
|
#==============
|
536
539
|
# profiles for locally hosted mobile web browsers (emulated locally in Firefox browser)
|
540
|
+
# NOTE: to host emulated mobile browsers in Chrome set the HOST_BROWSER=chrome
|
537
541
|
#==============
|
538
542
|
|
539
|
-
ipad: WEB_BROWSER=ipad <%= mobile %>
|
540
|
-
ipad_pro: WEB_BROWSER=ipad_pro <%= mobile %>
|
541
|
-
iphone: WEB_BROWSER=iphone <%= mobile %>
|
542
|
-
iphone4: WEB_BROWSER=iphone4 <%= mobile %>
|
543
|
-
iphone5: WEB_BROWSER=iphone5 <%= mobile %>
|
544
|
-
iphone6: WEB_BROWSER=iphone6 <%= mobile %>
|
545
|
-
iphone6_plus: WEB_BROWSER=iphone6_plus <%= mobile %>
|
546
|
-
android_phone: WEB_BROWSER=android_phone <%= mobile %>
|
547
|
-
android_tablet: WEB_BROWSER=android_tablet <%= mobile %>
|
548
|
-
windows_phone7: WEB_BROWSER=windows_phone7 <%= mobile %>
|
549
|
-
windows_phone8: WEB_BROWSER=windows_phone8 <%= mobile %>
|
543
|
+
ipad: WEB_BROWSER=ipad HOST_BROWSER=firefox <%= mobile %>
|
544
|
+
ipad_pro: WEB_BROWSER=ipad_pro HOST_BROWSER=firefox <%= mobile %>
|
545
|
+
iphone: WEB_BROWSER=iphone HOST_BROWSER=firefox <%= mobile %>
|
546
|
+
iphone4: WEB_BROWSER=iphone4 HOST_BROWSER=firefox <%= mobile %>
|
547
|
+
iphone5: WEB_BROWSER=iphone5 HOST_BROWSER=firefox <%= mobile %>
|
548
|
+
iphone6: WEB_BROWSER=iphone6 HOST_BROWSER=firefox <%= mobile %>
|
549
|
+
iphone6_plus: WEB_BROWSER=iphone6_plus HOST_BROWSER=firefox <%= mobile %>
|
550
|
+
android_phone: WEB_BROWSER=android_phone HOST_BROWSER=firefox <%= mobile %>
|
551
|
+
android_tablet: WEB_BROWSER=android_tablet HOST_BROWSER=firefox <%= mobile %>
|
552
|
+
windows_phone7: WEB_BROWSER=windows_phone7 HOST_BROWSER=firefox <%= mobile %>
|
553
|
+
windows_phone8: WEB_BROWSER=windows_phone8 HOST_BROWSER=firefox <%= mobile %>
|
550
554
|
|
551
555
|
|
552
556
|
#==============
|
@@ -791,12 +795,12 @@ To specify a locally hosted target browser using a profile at runtime, you use t
|
|
791
795
|
invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies that a local instance of Chrome
|
792
796
|
will be used as the target web browser:
|
793
797
|
|
794
|
-
cucumber -p chrome
|
798
|
+
$ cucumber -p chrome
|
795
799
|
|
796
800
|
The following command specifies that Cucumber will run tests against a local instance of Firefox, which will be used to emulate an iPad Pro
|
797
801
|
in landscape orientation:
|
798
802
|
|
799
|
-
cucumber -p ipad_pro -p landscape
|
803
|
+
$ cucumber -p ipad_pro -p landscape
|
800
804
|
|
801
805
|
The following command specifies that Cucumber will run tests against a remotely hosted Safari web browser running on an OS X Yosemite
|
802
806
|
virtual machine on the BrowserStack service:
|
@@ -806,7 +810,7 @@ virtual machine on the BrowserStack service:
|
|
806
810
|
The following command specifies that Cucumber will run tests against a remotely hosted Mobile Safari web browser on an iPhone 6s Plus in
|
807
811
|
landscape orientation running on the BrowserStack service:
|
808
812
|
|
809
|
-
cucumber -p bs_iphone6_plus -p landscape
|
813
|
+
$ cucumber -p bs_iphone6_plus -p landscape
|
810
814
|
|
811
815
|
|
812
816
|
|
@@ -47,8 +47,8 @@ module TestCentricity
|
|
47
47
|
rescue
|
48
48
|
unless state == obj.checked?
|
49
49
|
check_id = obj.native.attribute('id')
|
50
|
-
label = first("label[for='#{check_id}']")
|
51
|
-
label.click
|
50
|
+
label = first("label[for='#{check_id}']", :wait => 1, :visible => true)
|
51
|
+
label.click unless label.nil?
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -47,8 +47,8 @@ module TestCentricity
|
|
47
47
|
rescue
|
48
48
|
unless state == obj.checked?
|
49
49
|
check_id = obj.native.attribute('id')
|
50
|
-
label = first("label[for='#{check_id}']")
|
51
|
-
label.click
|
50
|
+
label = first("label[for='#{check_id}']", :wait => 1, :visible => true)
|
51
|
+
label.click unless label.nil?
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -59,9 +59,17 @@ module TestCentricity
|
|
59
59
|
Capybara::Selenium::Driver.new(app, :browser => browser.to_sym)
|
60
60
|
when :iphone, :iphone5, :iphone6, :iphone6_plus, :ipad, :ipad_pro, :android_phone, :android_tablet, :windows_phone7, :windows_phone8
|
61
61
|
Environ.set_platform(:mobile)
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
ENV['HOST_BROWSER'] ? host_browser = ENV['HOST_BROWSER'].downcase.to_sym : host_browser = :firefox
|
63
|
+
case host_browser
|
64
|
+
when :firefox
|
65
|
+
profile = Selenium::WebDriver::Firefox::Profile.new
|
66
|
+
profile['general.useragent.override'] = Browsers.mobile_device_agent(browser)
|
67
|
+
Capybara::Selenium::Driver.new(app, :profile => profile)
|
68
|
+
when :chrome
|
69
|
+
args = []
|
70
|
+
args << "--user-agent='#{Browsers.mobile_device_agent(browser)}'"
|
71
|
+
Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args)
|
72
|
+
end
|
65
73
|
else
|
66
74
|
Capybara::Selenium::Driver.new(app, :browser => :firefox)
|
67
75
|
Environ.set_browser('firefox')
|
data/testcentricity_web.gemspec
CHANGED
@@ -14,9 +14,9 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.description = %q{
|
15
15
|
TestCentricity™ core generic framework for desktop and mobile web site testing implements a Page Object Model DSL,
|
16
16
|
for use with Cucumber, Capybara, and Selenium-Webdriver. Supports testing against locally hosted desktop browsers
|
17
|
-
(Firefox, Chrome, Safari, IE, or Edge), locally hosted emulated iOS and Android mobile browsers (using Firefox
|
18
|
-
"headless" browser (using Poltergeist and PhantomJS), or on cloud hosted browsers using the BrowserStack,
|
19
|
-
CrossBrowserTesting, or TestingBot services.}
|
17
|
+
(Firefox, Chrome, Safari, IE, or Edge), locally hosted emulated iOS and Android mobile browsers (using Firefox or
|
18
|
+
Chrome), a "headless" browser (using Poltergeist and PhantomJS), or on cloud hosted browsers using the BrowserStack,
|
19
|
+
Sauce Labs, CrossBrowserTesting, or TestingBot services.}
|
20
20
|
spec.homepage = ''
|
21
21
|
spec.license = 'BSD3'
|
22
22
|
|
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: 0.
|
4
|
+
version: 0.8.0
|
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: 2016-04-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,9 +146,9 @@ description: |2-
|
|
146
146
|
|
147
147
|
TestCentricity™ core generic framework for desktop and mobile web site testing implements a Page Object Model DSL,
|
148
148
|
for use with Cucumber, Capybara, and Selenium-Webdriver. Supports testing against locally hosted desktop browsers
|
149
|
-
(Firefox, Chrome, Safari, IE, or Edge), locally hosted emulated iOS and Android mobile browsers (using Firefox
|
150
|
-
"headless" browser (using Poltergeist and PhantomJS), or on cloud hosted browsers using the BrowserStack,
|
151
|
-
CrossBrowserTesting, or TestingBot services.
|
149
|
+
(Firefox, Chrome, Safari, IE, or Edge), locally hosted emulated iOS and Android mobile browsers (using Firefox or
|
150
|
+
Chrome), a "headless" browser (using Poltergeist and PhantomJS), or on cloud hosted browsers using the BrowserStack,
|
151
|
+
Sauce Labs, CrossBrowserTesting, or TestingBot services.
|
152
152
|
email:
|
153
153
|
- test_automation@icloud.com
|
154
154
|
executables: []
|