testcentricity_web 3.1.11 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +11 -1
- data/Gemfile.lock +9 -9
- data/README.md +70 -8
- data/lib/testcentricity_web/browser_helper.rb +1 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +57 -0
- data/lib/testcentricity_web/web_elements/audio.rb +27 -2
- data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +24 -0
- data/lib/testcentricity_web/web_elements/video.rb +27 -2
- data/testcentricity_web.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 676c8b3a7cd7c2381b6b9c62f1cf300ec4a7c74ebd110e865a5c1607eedd4e7f
|
|
4
|
+
data.tar.gz: 23f02fd3a177c4d51394f944f4e6ffd5a8ad9b098c26412cf30342ccdf703268
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 271668919d950079396cc792b4d0ecf39189de49923d5c7d634b91444b786d8609740dfb7bdf33aa73b7a1b296780adb07391406808c2b5ed785d40071f76845
|
|
7
|
+
data.tar.gz: 3debabb5962cc9b1be7af9196ab3445b58e0639737060c1ce6751c7f7455f1ebaebb494575e248772c35495772980d67277e376b96c0cd18a874aca214f9776c
|
data/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
## [3.
|
|
5
|
+
## [3.2.0] - 2019-07-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
* Added support for connecting to and running your tests on cloud hosted browsers on the LambdaTest cloud platform.
|
|
9
|
+
* Added `UIElement.obscured?` and `UIElement.inspect` methods.
|
|
10
|
+
* Added `Video.wait_until_ready_state_is` and `Audio.wait_until_ready_state_is` methods.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
* `Video.ready_state` and `Audio.ready_state` methods now return an Integer result.
|
|
14
|
+
|
|
15
|
+
## [3.1.11] - 2019-06-20
|
|
6
16
|
|
|
7
17
|
### Added
|
|
8
18
|
* Added `SelectList.get_group_count` and `SelectList.get_group_headings` methods.
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
testcentricity_web (3.
|
|
4
|
+
testcentricity_web (3.2.0)
|
|
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 (10.
|
|
25
|
-
appium_lib_core (~> 3.
|
|
24
|
+
appium_lib (10.4.0)
|
|
25
|
+
appium_lib_core (~> 3.2)
|
|
26
26
|
nokogiri (~> 1.8, >= 1.8.1)
|
|
27
27
|
tomlrb (~> 1.1)
|
|
28
|
-
appium_lib_core (3.1
|
|
28
|
+
appium_lib_core (3.2.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.27.0)
|
|
37
37
|
addressable
|
|
38
38
|
mini_mime (>= 0.1.3)
|
|
39
39
|
nokogiri (~> 1.8)
|
|
@@ -51,7 +51,7 @@ GEM
|
|
|
51
51
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
52
52
|
equalizer (0.0.11)
|
|
53
53
|
eventmachine (1.2.7)
|
|
54
|
-
faker (
|
|
54
|
+
faker (2.0)
|
|
55
55
|
i18n (>= 0.7)
|
|
56
56
|
faye-websocket (0.10.9)
|
|
57
57
|
eventmachine (>= 0.12.0)
|
|
@@ -60,19 +60,19 @@ GEM
|
|
|
60
60
|
i18n (1.6.0)
|
|
61
61
|
concurrent-ruby (~> 1.0)
|
|
62
62
|
ice_nine (0.11.2)
|
|
63
|
-
mini_mime (1.0.
|
|
63
|
+
mini_mime (1.0.2)
|
|
64
64
|
mini_portile2 (2.4.0)
|
|
65
65
|
nokogiri (1.10.3)
|
|
66
66
|
mini_portile2 (~> 2.4.0)
|
|
67
67
|
os (1.0.1)
|
|
68
68
|
power_assert (1.1.4)
|
|
69
|
-
public_suffix (3.1.
|
|
69
|
+
public_suffix (3.1.1)
|
|
70
70
|
rack (2.0.7)
|
|
71
71
|
rack-test (1.1.0)
|
|
72
72
|
rack (>= 1.0, < 3)
|
|
73
73
|
rake (12.3.2)
|
|
74
74
|
redcarpet (3.4.0)
|
|
75
|
-
regexp_parser (1.
|
|
75
|
+
regexp_parser (1.6.0)
|
|
76
76
|
ruby-ole (1.2.12.2)
|
|
77
77
|
rubyzip (1.2.3)
|
|
78
78
|
selenium-webdriver (3.142.3)
|
data/README.md
CHANGED
|
@@ -17,9 +17,9 @@ The TestCentricity™ Web gem supports running automated tests against the follo
|
|
|
17
17
|
* mobile Chrome or Android browsers on Android Studio virtual device emulators (using Appium and Android Studio on OS X)
|
|
18
18
|
* 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),
|
|
19
19
|
[Sauce Labs](https://saucelabs.com/open-source#automated-testing-platform), [CrossBrowserTesting](https://crossbrowsertesting.com/selenium-testing),
|
|
20
|
-
[TestingBot](https://testingbot.com/features),
|
|
20
|
+
[TestingBot](https://testingbot.com/features), [Gridlastic](https://www.gridlastic.com/test-environments.html), or [LambdaTest](https://www.lambdatest.com/selenium-automation) services.
|
|
21
21
|
* web portals utilizing JavaScript front end application frameworks like Ember, React, Angular, and GWT
|
|
22
|
-
* enterprise web portals
|
|
22
|
+
* enterprise web portals built using Siebel Open UI
|
|
23
23
|
* web pages containing HTML5 Video and Audio objects
|
|
24
24
|
|
|
25
25
|
|
|
@@ -488,6 +488,7 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
|
488
488
|
element.enabled?
|
|
489
489
|
element.disabled?
|
|
490
490
|
element.displayed?
|
|
491
|
+
element.obscured?
|
|
491
492
|
element.get_value
|
|
492
493
|
element.count
|
|
493
494
|
element.style
|
|
@@ -498,6 +499,7 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
|
|
|
498
499
|
element.y
|
|
499
500
|
element.get_attribute(attrib)
|
|
500
501
|
element.get_native_attribute(attrib)
|
|
502
|
+
element.inspect
|
|
501
503
|
|
|
502
504
|
**Object Accessibility (A11y) methods:**
|
|
503
505
|
|
|
@@ -904,8 +906,8 @@ Once your test environment is properly configured, the following **Environment V
|
|
|
904
906
|
### Remotely hosted desktop and mobile web browsers
|
|
905
907
|
|
|
906
908
|
You can run your automated tests against remotely hosted desktop and mobile web browsers using the BrowserStack, CrossBrowserTesting,
|
|
907
|
-
Sauce Labs, or
|
|
908
|
-
staging server inside your LAN, you must set the `TUNNELING` Environment Variable to `true`.
|
|
909
|
+
Sauce Labs, TestingBot, Gridlastic, or LambdaTest services. If your tests are running against a web site hosted on your local computer
|
|
910
|
+
(`localhost`), or on a staging server inside your LAN, you must set the `TUNNELING` Environment Variable to `true`.
|
|
909
911
|
|
|
910
912
|
|
|
911
913
|
#### Remote desktop browsers on the BrowserStack service
|
|
@@ -1086,6 +1088,29 @@ regarding the specific capabilities.
|
|
|
1086
1088
|
`VIDEO_URL` | [Optional] Video Files Location Endpoint URL shown in the **Your Selenium Grid Credentials** section of the Gridlastic Dashboard
|
|
1087
1089
|
|
|
1088
1090
|
|
|
1091
|
+
|
|
1092
|
+
#### Remote desktop browsers on the LambdaTest service
|
|
1093
|
+
|
|
1094
|
+
For remotely hosted desktop web browsers on the LambdaTest service, the following **Environment Variables** must be set as described in the table
|
|
1095
|
+
below. Use the Configuration Wizard on the [Selenium Desired Capabilities Generator](https://www.lambdatest.com/capabilities-generator/) to obtain
|
|
1096
|
+
information regarding the specific capabilities.
|
|
1097
|
+
|
|
1098
|
+
**Environment Variable** | **Description**
|
|
1099
|
+
--------------- | ----------------
|
|
1100
|
+
`WEB_BROWSER` | Must be set to `lambdatest`
|
|
1101
|
+
`LT_USERNAME` | Must be set to your LambdaTest account user name or email address
|
|
1102
|
+
`LT_AUTHKEY` | Must be set to your LambdaTest account access key
|
|
1103
|
+
`LT_OS` | Refer to `platform` capability in the sample script of the Wizard
|
|
1104
|
+
`LT_BROWSER` | Refer to `browserName` capability in the sample script of the Wizard
|
|
1105
|
+
`LT_VERSION` | Refer to `version` capability in chart
|
|
1106
|
+
`RESOLUTION` | [Optional] Refer to supported `resolution` capability in the sample script of the Wizard
|
|
1107
|
+
`BROWSER_SIZE` | [Optional] Specify width, height of browser window
|
|
1108
|
+
`RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
|
|
1109
|
+
`ALLOW_POPUPS` | [Optional] Allow popups (`true` or `false`) - for Safari, IE, and Edge browsers only
|
|
1110
|
+
`ALLOW_COOKIES` | [Optional] Allow all cookies (`true` or `false`) - for Safari browsers only
|
|
1111
|
+
`CONSOLE_LOGS` | [Optional] Used to capture browser console logs.
|
|
1112
|
+
|
|
1113
|
+
|
|
1089
1114
|
### Using Browser specific Profiles in cucumber.yml
|
|
1090
1115
|
|
|
1091
1116
|
While you can set **Environment Variables** in the command line when invoking Cucumber, a preferred method of specifying and managing
|
|
@@ -1093,10 +1118,10 @@ target web browsers is to create browser specific **Profiles** that set the appr
|
|
|
1093
1118
|
in your `cucumber.yml` file.
|
|
1094
1119
|
|
|
1095
1120
|
Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these in in your
|
|
1096
|
-
`cucumber.yml` file). Before you can use the BrowserStack, CrossBrowserTesting, Sauce Labs, TestingBot, or
|
|
1097
|
-
replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for
|
|
1098
|
-
service(s) that you intend to connect with. When using the Gridlastic service, you will also need replace the *INSERT SUBDOMAIN HERE*
|
|
1099
|
-
text with the Subdomain specified on the Grid Configuration Parameters section of the Gridlastic Dashboard.
|
|
1121
|
+
`cucumber.yml` file). Before you can use the BrowserStack, CrossBrowserTesting, Sauce Labs, TestingBot, Gridlastic or LambdaTest services, you
|
|
1122
|
+
will need to replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for
|
|
1123
|
+
the cloud service(s) that you intend to connect with. When using the Gridlastic service, you will also need replace the *INSERT SUBDOMAIN HERE*
|
|
1124
|
+
placeholder text with the Subdomain specified on the Grid Configuration Parameters section of the Gridlastic Dashboard.
|
|
1100
1125
|
|
|
1101
1126
|
|
|
1102
1127
|
<% desktop = "--tags @desktop --require features BROWSER_TILE=true BROWSER_SIZE=1500,1000" %>
|
|
@@ -1144,6 +1169,9 @@ text with the Subdomain specified on the Grid Configuration Parameters section o
|
|
|
1144
1169
|
iphone8_plus: WEB_BROWSER=iphone8_plus HOST_BROWSER=chrome <%= mobile %>
|
|
1145
1170
|
iphone_x: WEB_BROWSER=iphone_x HOST_BROWSER=chrome <%= mobile %>
|
|
1146
1171
|
iphone_xr: WEB_BROWSER=iphone_xr HOST_BROWSER=chrome <%= mobile %>
|
|
1172
|
+
iphone_xr_chrome: WEB_BROWSER=iphone_xr_chrome HOST_BROWSER=chrome <%= mobile %>
|
|
1173
|
+
iphone_xr_firefox: WEB_BROWSER=iphone_xr_firefox HOST_BROWSER=chrome <%= mobile %>
|
|
1174
|
+
iphone_xr_edge: WEB_BROWSER=iphone_xr_edge HOST_BROWSER=chrome <%= mobile %>
|
|
1147
1175
|
iphone_xs: WEB_BROWSER=iphone_xs HOST_BROWSER=chrome <%= mobile %>
|
|
1148
1176
|
iphone_xs_max: WEB_BROWSER=iphone_xs_max HOST_BROWSER=chrome <%= mobile %>
|
|
1149
1177
|
android_phone: WEB_BROWSER=android_phone HOST_BROWSER=chrome <%= mobile %>
|
|
@@ -1517,6 +1545,40 @@ text with the Subdomain specified on the Grid Configuration Parameters section o
|
|
|
1517
1545
|
gl_chrome_linux: --profile gl_desktop GL_OS="LINUX" GL_BROWSER="chrome" GL_VERSION="latest"
|
|
1518
1546
|
|
|
1519
1547
|
|
|
1548
|
+
#==============
|
|
1549
|
+
# profiles for remotely hosted web browsers on the LambdaTest service
|
|
1550
|
+
#==============
|
|
1551
|
+
|
|
1552
|
+
lambdatest: WEB_BROWSER=lambdatest LT_USERNAME=<INSERT USER NAME HERE> LT_AUTHKEY=<INSERT PASSWORD HERE>
|
|
1553
|
+
lt_desktop: --profile lambdatest <%= desktop %> RESOLUTION="1920x1080"
|
|
1554
|
+
lt_firefox: LT_BROWSER="Firefox" LT_VERSION="67.0"
|
|
1555
|
+
lt_chrome: LT_BROWSER="Chrome" LT_VERSION="76.0"
|
|
1556
|
+
lt_safari: LT_BROWSER="Safari" ALLOW_COOKIES="true" ALLOW_POPUPS="true"
|
|
1557
|
+
|
|
1558
|
+
# LambdaTest OS X desktop browser profiles
|
|
1559
|
+
lt_macos_mojave: --profile lt_desktop LT_OS="macOS Mojave"
|
|
1560
|
+
lt_ff_mojave: --profile lt_macos_mojave --profile lt_firefox
|
|
1561
|
+
lt_chrome_mojave: --profile lt_macos_mojave --profile lt_chrome
|
|
1562
|
+
lt_safari_mojave: --profile lt_macos_mojave --profile lt_safari LT_VERSION="12.0"
|
|
1563
|
+
|
|
1564
|
+
lt_macos_high_sierra: --profile lt_desktop LT_OS="macOS High Sierra"
|
|
1565
|
+
lt_ff_high_sierra: --profile lt_macos_high_sierra --profile lt_firefox
|
|
1566
|
+
lt_chrome_high_sierra: --profile lt_macos_high_sierra --profile lt_chrome
|
|
1567
|
+
lt_safari_high_sierra: --profile lt_macos_high_sierra --profile lt_safari LT_VERSION="11.0"
|
|
1568
|
+
|
|
1569
|
+
lt_macos_sierra: --profile lt_desktop LT_OS="macOS Sierra"
|
|
1570
|
+
lt_ff_sierra: --profile lt_macos_sierra --profile lt_firefox
|
|
1571
|
+
lt_chrome_sierra: --profile lt_macos_sierra --profile lt_chrome
|
|
1572
|
+
lt_safari_sierra: --profile lt_macos_sierra --profile lt_safari LT_VERSION="10.0"
|
|
1573
|
+
|
|
1574
|
+
# LambdaTest Windows desktop browser profiles
|
|
1575
|
+
lt_win10: --profile lt_desktop LT_OS="Windows 10"
|
|
1576
|
+
lt_ff_win10: --profile lt_win10 --profile lt_firefox
|
|
1577
|
+
lt_chrome_win10: --profile lt_win10 --profile lt_chrome
|
|
1578
|
+
lt_ie11_win10: --profile lt_win10 LT_BROWSER="Internet Explorer" LT_VERSION="11.0"
|
|
1579
|
+
lt_edge_win10: --profile lt_win10 LT_BROWSER="MicrosoftEdge" LT_VERSION="18.0"
|
|
1580
|
+
|
|
1581
|
+
|
|
1520
1582
|
To specify a locally hosted target browser using a profile at runtime, you use the flag `--profile` or `-p` followed by the profile name when
|
|
1521
1583
|
invoking Cucumber in the command line. For instance, the following command invokes Cucumber and specifies that a local instance of Firefox
|
|
1522
1584
|
will be used as the target web browser:
|
|
@@ -39,6 +39,9 @@ module TestCentricity
|
|
|
39
39
|
when :gridlastic
|
|
40
40
|
initialize_gridlastic
|
|
41
41
|
context = 'Gridlastic cloud service'
|
|
42
|
+
when :lambdatest
|
|
43
|
+
initialize_lambdatest
|
|
44
|
+
context = 'LambdaTest cloud service'
|
|
42
45
|
when :saucelabs
|
|
43
46
|
initialize_saucelabs
|
|
44
47
|
context = 'Sauce Labs cloud service'
|
|
@@ -434,6 +437,60 @@ module TestCentricity
|
|
|
434
437
|
end
|
|
435
438
|
end
|
|
436
439
|
|
|
440
|
+
def self.initialize_lambdatest
|
|
441
|
+
browser = ENV['LT_BROWSER']
|
|
442
|
+
Environ.grid = :lambdatest
|
|
443
|
+
Environ.os = ENV['LT_OS']
|
|
444
|
+
Environ.platform = :desktop
|
|
445
|
+
Environ.tunneling = ENV['TUNNELING'] if ENV['TUNNELING']
|
|
446
|
+
|
|
447
|
+
endpoint = "http://#{ENV['LT_USERNAME']}:#{ENV['LT_AUTHKEY']}@hub.lambdatest.com/wd/hub"
|
|
448
|
+
Capybara.register_driver :lambdatest do |app|
|
|
449
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.new
|
|
450
|
+
capabilities['name'] = ENV['AUTOMATE_PROJECT'] if ENV['AUTOMATE_PROJECT']
|
|
451
|
+
capabilities['browserName'] = browser
|
|
452
|
+
capabilities['version'] = ENV['LT_VERSION'] if ENV['LT_VERSION']
|
|
453
|
+
capabilities['platform'] = ENV['LT_OS']
|
|
454
|
+
capabilities['resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
|
|
455
|
+
capabilities['video'] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
|
|
456
|
+
capabilities['console'] = ENV['CONSOLE_LOGS'] if ENV['CONSOLE_LOGS']
|
|
457
|
+
capabilities['network'] = true
|
|
458
|
+
capabilities['visual'] = true
|
|
459
|
+
capabilities['tunnel'] = ENV['TUNNELING'] if ENV['TUNNELING']
|
|
460
|
+
|
|
461
|
+
case browser.downcase.to_sym
|
|
462
|
+
when :safari
|
|
463
|
+
capabilities['safari.popups'] = ENV['ALLOW_POPUPS'] if ENV['ALLOW_POPUPS']
|
|
464
|
+
capabilities['safari.cookies'] = ENV['ALLOW_COOKIES'] if ENV['ALLOW_COOKIES']
|
|
465
|
+
when :ie
|
|
466
|
+
capabilities['ie.popups'] = ENV['ALLOW_POPUPS'] if ENV['ALLOW_POPUPS']
|
|
467
|
+
when :edge
|
|
468
|
+
capabilities['edge.popups'] = ENV['ALLOW_POPUPS'] if ENV['ALLOW_POPUPS']
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
context_message = ENV['TEST_CONTEXT'] ? "#{Environ.test_environment.upcase} - #{ENV['TEST_CONTEXT']}" : Environ.test_environment.upcase
|
|
472
|
+
if ENV['PARALLEL']
|
|
473
|
+
thread_num = ENV['TEST_ENV_NUMBER']
|
|
474
|
+
thread_num = 1 if thread_num.blank?
|
|
475
|
+
context_message = "#{context_message} - Thread ##{thread_num}"
|
|
476
|
+
end
|
|
477
|
+
capabilities['build'] = context_message
|
|
478
|
+
|
|
479
|
+
Capybara::Selenium::Driver.new(app, browser: :remote, url: endpoint, desired_capabilities: capabilities)
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
Environ.browser = browser
|
|
483
|
+
|
|
484
|
+
Capybara.default_driver = :lambdatest
|
|
485
|
+
Capybara.run_server = false
|
|
486
|
+
# configure file_detector for remote uploads
|
|
487
|
+
selenium = Capybara.page.driver.browser
|
|
488
|
+
selenium.file_detector = lambda do |args|
|
|
489
|
+
str = args.first.to_s
|
|
490
|
+
str if File.exist?(str)
|
|
491
|
+
end
|
|
492
|
+
end
|
|
493
|
+
|
|
437
494
|
def self.initialize_remote
|
|
438
495
|
Environ.grid = :selenium_grid
|
|
439
496
|
browser = ENV['WEB_BROWSER'].downcase.to_sym
|
|
@@ -171,14 +171,39 @@ module TestCentricity
|
|
|
171
171
|
|
|
172
172
|
# Return audio readyState property
|
|
173
173
|
#
|
|
174
|
-
# @return [Integer
|
|
174
|
+
# @return [Integer] audio ready state
|
|
175
|
+
# 0 = HAVE_NOTHING - no information whether or not the audio/video is ready
|
|
176
|
+
# 1 = HAVE_METADATA - metadata for the audio/video is ready
|
|
177
|
+
# 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
|
|
178
|
+
# 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
|
|
179
|
+
# 4 = HAVE_ENOUGH_DATA - enough data available to start playing
|
|
175
180
|
# @example
|
|
176
181
|
# audio_status = audio_player.ready_state
|
|
177
182
|
#
|
|
178
183
|
def ready_state
|
|
179
184
|
obj, = find_element(visible = :all)
|
|
180
185
|
object_not_found_exception(obj, :audio)
|
|
181
|
-
obj.native.attribute('readyState')
|
|
186
|
+
obj.native.attribute('readyState').to_i
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Wait until the audio object's readyState value equals the specified value, or until the specified wait time has expired. If the wait
|
|
190
|
+
# time is nil, then the wait time will be Capybara.default_max_wait_time.
|
|
191
|
+
#
|
|
192
|
+
# @param value [Integer] value expected
|
|
193
|
+
# @param seconds [Integer or Float] wait time in seconds
|
|
194
|
+
# @example
|
|
195
|
+
# audio_player.wait_until_ready_state_is(4, 5)
|
|
196
|
+
#
|
|
197
|
+
def wait_until_ready_state_is(value, seconds = nil, post_exception = true)
|
|
198
|
+
timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
|
|
199
|
+
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
|
200
|
+
wait.until { ready_state == value }
|
|
201
|
+
rescue StandardError
|
|
202
|
+
if post_exception
|
|
203
|
+
raise "Ready state of Audio #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_value == value
|
|
204
|
+
else
|
|
205
|
+
ready_state == value
|
|
206
|
+
end
|
|
182
207
|
end
|
|
183
208
|
|
|
184
209
|
# Return audio volume property
|
|
@@ -251,6 +251,30 @@ module TestCentricity
|
|
|
251
251
|
obj.disabled?
|
|
252
252
|
end
|
|
253
253
|
|
|
254
|
+
# Is UI object obscured (not currently in viewport and not clickable)?
|
|
255
|
+
#
|
|
256
|
+
# @return [Boolean]
|
|
257
|
+
# @example
|
|
258
|
+
# buy_now_button.obscured?
|
|
259
|
+
#
|
|
260
|
+
def obscured?
|
|
261
|
+
obj, type = find_element
|
|
262
|
+
object_not_found_exception(obj, type)
|
|
263
|
+
obj.obscured?
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Return a human readable representation of the UI element
|
|
267
|
+
#
|
|
268
|
+
# @return [String]
|
|
269
|
+
# @example
|
|
270
|
+
# buy_now_button.inspect
|
|
271
|
+
#
|
|
272
|
+
def inspect
|
|
273
|
+
obj, type = find_element
|
|
274
|
+
object_not_found_exception(obj, type)
|
|
275
|
+
obj.inspect
|
|
276
|
+
end
|
|
277
|
+
|
|
254
278
|
# Wait until the object exists, or until the specified wait time has expired. If the wait time is nil, then the wait
|
|
255
279
|
# time will be Capybara.default_max_wait_time.
|
|
256
280
|
#
|
|
@@ -171,14 +171,39 @@ module TestCentricity
|
|
|
171
171
|
|
|
172
172
|
# Return video readyState property
|
|
173
173
|
#
|
|
174
|
-
# @return [Integer
|
|
174
|
+
# @return [Integer] video ready state
|
|
175
|
+
# 0 = HAVE_NOTHING - no information whether or not the audio/video is ready
|
|
176
|
+
# 1 = HAVE_METADATA - metadata for the audio/video is ready
|
|
177
|
+
# 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
|
|
178
|
+
# 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
|
|
179
|
+
# 4 = HAVE_ENOUGH_DATA - enough data available to start playing
|
|
175
180
|
# @example
|
|
176
181
|
# vid_status = video_player.ready_state
|
|
177
182
|
#
|
|
178
183
|
def ready_state
|
|
179
184
|
obj, = find_element
|
|
180
185
|
object_not_found_exception(obj, nil)
|
|
181
|
-
obj.native.attribute('readyState')
|
|
186
|
+
obj.native.attribute('readyState').to_i
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Wait until the video object's readyState value equals the specified value, or until the specified wait time has expired. If the wait
|
|
190
|
+
# time is nil, then the wait time will be Capybara.default_max_wait_time.
|
|
191
|
+
#
|
|
192
|
+
# @param value [Integer] value expected
|
|
193
|
+
# @param seconds [Integer or Float] wait time in seconds
|
|
194
|
+
# @example
|
|
195
|
+
# video_player.wait_until_ready_state_is(4, 5)
|
|
196
|
+
#
|
|
197
|
+
def wait_until_ready_state_is(value, seconds = nil, post_exception = true)
|
|
198
|
+
timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
|
|
199
|
+
wait = Selenium::WebDriver::Wait.new(timeout: timeout)
|
|
200
|
+
wait.until { ready_state == value }
|
|
201
|
+
rescue StandardError
|
|
202
|
+
if post_exception
|
|
203
|
+
raise "Ready state of Video #{object_ref_message} failed to equal '#{value}' after #{timeout} seconds" unless get_value == value
|
|
204
|
+
else
|
|
205
|
+
ready_state == value
|
|
206
|
+
end
|
|
182
207
|
end
|
|
183
208
|
|
|
184
209
|
# Return video volume property
|
data/testcentricity_web.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
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
|
|
21
|
+
BrowserStack, Sauce Labs, CrossBrowserTesting, TestingBot, Gridlastic, or LambdaTest 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.
|
|
4
|
+
version: 3.2.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: 2019-
|
|
11
|
+
date: 2019-07-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -240,7 +240,7 @@ description: |2-
|
|
|
240
240
|
Phone, Blackberry, Kindle Fire) running within a local instance of Chrome, mobile Safari browsers on iOS device simulators
|
|
241
241
|
or physical iOS devices (using Appium and XCode on OS X), mobile Chrome or Android browsers on Android Studio virtual
|
|
242
242
|
device emulators (using Appium and Android Studio on OS X), or cloud hosted desktop or mobile web browsers (using the
|
|
243
|
-
BrowserStack, Sauce Labs, CrossBrowserTesting, TestingBot, or
|
|
243
|
+
BrowserStack, Sauce Labs, CrossBrowserTesting, TestingBot, Gridlastic, or LambdaTest services).
|
|
244
244
|
email:
|
|
245
245
|
- testcentricity@gmail.com
|
|
246
246
|
executables: []
|
|
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
325
325
|
requirements:
|
|
326
326
|
- Capybara, Selenium-WebDriver
|
|
327
327
|
rubyforge_project:
|
|
328
|
-
rubygems_version: 2.
|
|
328
|
+
rubygems_version: 2.7.9
|
|
329
329
|
signing_key:
|
|
330
330
|
specification_version: 4
|
|
331
331
|
summary: A Page Object and Data Object Model Framework for desktop and mobile web
|