testcentricity_web 4.4.1 → 4.4.2
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +68 -0
- data/lib/testcentricity_web/version.rb +1 -1
- data/lib/testcentricity_web/web_core/webdriver_helper.rb +25 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e92bc217ff919e7d3d53cd50cf535636d62e13a71314608d2942c104e3438a29
|
4
|
+
data.tar.gz: 2a7aeb90967173c977ceddf1cc61f3f10e17d5d4420a2cf666b53431d9482907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9cabcb32923ec4a5fb41bcc469ceb27118900b5feb54f88d16d623c8b70ecef2a80ecce52f12716ae629dee9b0fd6ed7b97971cb1c3c5878dc2b54d532cf4b6
|
7
|
+
data.tar.gz: 2b112b60bee132159ef62204065976ff92ee28b60c47c007946a2501831d9c18f34230338fedadac266dd76f80ac411354f44b07ac6c76c0982c91c9d5bd3665
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
4
|
|
5
|
+
## [4.4.2] - 22-DEC-2023
|
6
|
+
|
7
|
+
### Added
|
8
|
+
* Added support for specifying and connecting to web browsers on unsupported cloud hosting services using `custom` user-
|
9
|
+
defined driver and capabilities.
|
10
|
+
|
11
|
+
|
5
12
|
## [4.4.0] - 22-DEC-2023
|
6
13
|
|
7
14
|
### Added
|
data/README.md
CHANGED
@@ -2739,6 +2739,74 @@ test configuration options.
|
|
2739
2739
|
WebDriverConnect.initialize_web_driver(options)
|
2740
2740
|
|
2741
2741
|
|
2742
|
+
#### Remote Browsers on Unsupported Cloud Hosting Services
|
2743
|
+
|
2744
|
+
Limited support is provided for executing automated tests against remotely hosted desktop and mobile web browsers on currently
|
2745
|
+
unsupported cloud hosting services. You must call the `TestCentricity::WebDriverConnect.initialize_web_driver` method with
|
2746
|
+
an `options` hash - Environment Variables cannot be used to specify a user-defined custom WebDriver instance.
|
2747
|
+
|
2748
|
+
The following options and capabilities must be specified:
|
2749
|
+
- `driver:` must be set to `:custom`
|
2750
|
+
- `endpoint:` must be set to the endpoint URL configuration specified by the hosting service
|
2751
|
+
- `browserName:` in the `capabilities:` hash must be set to name from capability specified by the hosting service
|
2752
|
+
|
2753
|
+
All other required capabilities specified by the hosting service configuration documentation should be included in the
|
2754
|
+
`capabilities:` hash.
|
2755
|
+
|
2756
|
+
options = {
|
2757
|
+
driver: :custom,
|
2758
|
+
endpoint: endpoint_url,
|
2759
|
+
capabilities: { browserName: browser_name_from_chart }
|
2760
|
+
}
|
2761
|
+
WebDriverConnect.initialize_web_driver(options)
|
2762
|
+
|
2763
|
+
ℹ️ If an optional user defined `driver_name:` is not specified in the `options` hash, the default driver name will be set to
|
2764
|
+
`:custom_<browserName>` - e.g. `:custom_chrome` or `:custom_safari`.
|
2765
|
+
|
2766
|
+
Prior to calling the `TestCentricity::WebDriverConnect.initialize_web_driver` method, you must set `Environ.platform` to
|
2767
|
+
either `:desktop` or `:mobile`, and `Environ.device` to either `:web` or `:device` dependent on whether the target browser
|
2768
|
+
is a desktop browser or a mobile browser running on a mobile device or simulator.
|
2769
|
+
|
2770
|
+
Below is an example for specifying a connection to a Firefox desktop web browser on an unsupported hosting service:
|
2771
|
+
|
2772
|
+
# specify desktop platform
|
2773
|
+
Environ.platform = :desktop
|
2774
|
+
Environ.device = :web
|
2775
|
+
# instantiate a cloud hosted desktop web browser on an unsupported hosting service
|
2776
|
+
options = {
|
2777
|
+
driver: :custom,
|
2778
|
+
driver_name: :user_defined,
|
2779
|
+
browser_size: [1400, 1100],
|
2780
|
+
endpoint: endpoint_url,
|
2781
|
+
capabilities: {
|
2782
|
+
browserName: 'Firefox',
|
2783
|
+
browser_version: browser_version_from_chart
|
2784
|
+
# other capabilities go here
|
2785
|
+
}
|
2786
|
+
}
|
2787
|
+
WebDriverConnect.initialize_web_driver(options)
|
2788
|
+
|
2789
|
+
Below is an example for specifying a connection to a mobile Safari web browser running on an iPad on an unsupported hosting
|
2790
|
+
service:
|
2791
|
+
|
2792
|
+
# specify mobile platform, device type, and device name
|
2793
|
+
Environ.platform = :mobile
|
2794
|
+
Environ.device = :device
|
2795
|
+
Environ.device_name = device_name_from_chart
|
2796
|
+
# instantiate a cloud hosted mobile browser on a device on an unsupported hosting service
|
2797
|
+
options = {
|
2798
|
+
driver: :custom,
|
2799
|
+
driver_name: :user_defined,
|
2800
|
+
device_type: :tablet,
|
2801
|
+
endpoint: endpoint_url,
|
2802
|
+
capabilities: {
|
2803
|
+
browserName: 'Safari',
|
2804
|
+
# other capabilities go here
|
2805
|
+
}
|
2806
|
+
}
|
2807
|
+
WebDriverConnect.initialize_web_driver(options)
|
2808
|
+
|
2809
|
+
|
2742
2810
|
### Closing Browser and Driver Instances
|
2743
2811
|
|
2744
2812
|
#### Closing Instances Using Cucumber
|
@@ -43,7 +43,11 @@ module TestCentricity
|
|
43
43
|
Environ.browser = ENV['WEB_BROWSER'] if ENV['WEB_BROWSER']
|
44
44
|
Environ.device_orientation = ENV['ORIENTATION'] if ENV['ORIENTATION']
|
45
45
|
else
|
46
|
-
|
46
|
+
if @capabilities[:browserName]
|
47
|
+
Environ.browser = @capabilities[:browserName]
|
48
|
+
else
|
49
|
+
raise 'Missing :browserName in @capabilities'
|
50
|
+
end
|
47
51
|
Environ.device_orientation = @capabilities[:orientation] if @capabilities[:orientation]
|
48
52
|
Environ.device_orientation = @capabilities[:'appium:orientation'] if @capabilities[:'appium:orientation']
|
49
53
|
end
|
@@ -51,10 +55,12 @@ module TestCentricity
|
|
51
55
|
Environ.driver = :webdriver if Environ.driver.nil?
|
52
56
|
Environ.device_type = ENV['DEVICE_TYPE'] if ENV['DEVICE_TYPE']
|
53
57
|
# assume that we're testing within a local desktop web browser
|
54
|
-
Environ.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
unless Environ.driver == :custom
|
59
|
+
Environ.platform = :desktop
|
60
|
+
Environ.headless = false
|
61
|
+
Environ.device = :web
|
62
|
+
Environ.device_name = 'browser'
|
63
|
+
end
|
58
64
|
|
59
65
|
context = case Environ.driver
|
60
66
|
when :appium
|
@@ -80,6 +86,11 @@ module TestCentricity
|
|
80
86
|
initialize_lambdatest
|
81
87
|
'LambdaTest cloud service'
|
82
88
|
# :nocov:
|
89
|
+
when :custom
|
90
|
+
raise 'User-defined webdriver requires that you define options' if options.nil?
|
91
|
+
|
92
|
+
initialize_custom_driver
|
93
|
+
'custom user-defined webdriver'
|
83
94
|
else
|
84
95
|
raise "#{Environ.driver} is not a supported driver"
|
85
96
|
end
|
@@ -683,6 +694,15 @@ module TestCentricity
|
|
683
694
|
end
|
684
695
|
# :nocov:
|
685
696
|
|
697
|
+
def self.initialize_custom_driver
|
698
|
+
raise 'User-defined webdriver requires that you provide capabilities' if @capabilities.nil?
|
699
|
+
raise 'User-defined webdriver requires that you provide an endpoint' if @endpoint.nil?
|
700
|
+
|
701
|
+
Environ.browser = @capabilities[:browserName]
|
702
|
+
Environ.grid = :custom
|
703
|
+
register_remote_driver(Environ.browser, @capabilities)
|
704
|
+
end
|
705
|
+
|
686
706
|
def self.chrome_edge_options(browser)
|
687
707
|
options = case browser
|
688
708
|
when :chrome, :chrome_headless
|
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: 4.4.
|
4
|
+
version: 4.4.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: 2023-12-
|
11
|
+
date: 2023-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -376,7 +376,7 @@ metadata:
|
|
376
376
|
changelog_uri: https://github.com/TestCentricity/testcentricity_web/blob/main/CHANGELOG.md
|
377
377
|
bug_tracker_uri: https://github.com/TestCentricity/testcentricity_web/issues
|
378
378
|
wiki_uri: https://github.com/TestCentricity/testcentricity_web/wiki
|
379
|
-
documentation_uri: https://www.rubydoc.info/gems/testcentricity_web
|
379
|
+
documentation_uri: https://www.rubydoc.info/gems/testcentricity_web
|
380
380
|
post_install_message:
|
381
381
|
rdoc_options: []
|
382
382
|
require_paths:
|