testcentricity_web 4.4.1 → 4.4.3

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
  SHA256:
3
- metadata.gz: 20ddb032add01d0bf8cbd1b2e5edfa456b31b3898dca0a1888720aa7cb23362a
4
- data.tar.gz: 149f1b14ff524c3eb825081d5f6e695e4695dabefb1ac5218c9b91a38f33718f
3
+ metadata.gz: a8c968e47a6f1c58903fd78ecacef42a3a6897714fba982cdde8045c2079f80a
4
+ data.tar.gz: 3d863cb52a2384e6fdeb3128425797ebe9e42d6f53f58d222d3b4e680b19fec1
5
5
  SHA512:
6
- metadata.gz: 93826b487631ebe3060aa63165333bbddfdbbca89e07e2d48984afe8880ac14c09f00cffa779c3de51fd35f0f2bfe0e7961aea3a433a166b209bed2f4e53303d
7
- data.tar.gz: 355fcb18b798e95e79d28d5b0800bbb64a17d431e20db8fd750c56480d74f655246d81259a8546143a30026c9c9aa6fca908c9a9dc89271070f66988d37f1437
6
+ metadata.gz: 382f74e7baf7e34f7e2a02b602a91eb00029ced5bc518ddf967298ea95e18050592c03b51692372cf55b8f879d599155d07b1eaf5590d5c7a4376ee905613165
7
+ data.tar.gz: cd88dbd29452dcf44294a775e48ba939578cc2f1936229d630fffecaaf7afa0c2082e8b8ff2b6f1d530462d700e70128ab8f695587538872ef6724c2eecbb232
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [4.4.3] - 24-DEC-2023
6
+
7
+ ### Changed
8
+ * Changed Sauce Labs `DATA_CENTER` Environment Variable to `SL_DATA_CENTER`.
9
+
10
+
11
+ ## [4.4.2] - 23-DEC-2023
12
+
13
+ ### Added
14
+ * Added support for specifying and connecting to web browsers on unsupported cloud hosting services using `custom` user-
15
+ defined driver and capabilities.
16
+
17
+
5
18
  ## [4.4.0] - 22-DEC-2023
6
19
 
7
20
  ### Added
data/README.md CHANGED
@@ -2327,7 +2327,7 @@ the following **Environment Variables** must be set as described in the table be
2327
2327
  | `DRIVER` | Must be set to `saucelabs` |
2328
2328
  | `SL_USERNAME` | Must be set to your Sauce Labs account user name or email address |
2329
2329
  | `SL_AUTHKEY` | Must be set to your Sauce Labs account access key |
2330
- | `DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
2330
+ | `SL_DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
2331
2331
  | `SL_OS` | Refer to `platformName` capability in the Config Script section of the Platform Configurator page |
2332
2332
  | `SL_BROWSER` | Must be set to `chrome`, `firefox`, `safari`, `internetExplorer`, or `MicrosoftEdge` |
2333
2333
  | `SL_VERSION` | Refer to `browserVersion` capability in the Config Script section of the Platform Configurator page |
@@ -2363,11 +2363,11 @@ When using the `options` hash, the following options and capabilities must be sp
2363
2363
 
2364
2364
  ℹ️ If an `endpoint:` is not specified in the `options` hash, then the default remote endpoint URL will be set to the following:
2365
2365
 
2366
- `https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['DATA_CENTER']}.saucelabs.com:443/wd/hub`
2366
+ `https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['SL_DATA_CENTER']}.saucelabs.com:443/wd/hub`
2367
2367
 
2368
2368
  This default endpoint requires that the `SL_USERNAME` Environment Variable is set to your Sauce Labs account user name, the
2369
- `SL_AUTHKEY` Environment Variable is set to your Sauce Labs access key, and the `DATA_CENTER` Environment Variable is set to
2370
- your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`).
2369
+ `SL_AUTHKEY` Environment Variable is set to your Sauce Labs access key, and the `SL_DATA_CENTER` Environment Variable is
2370
+ set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`).
2371
2371
 
2372
2372
  Below is an example of an `options` hash for specifying a connection to the latest version of an Edge desktop web browser
2373
2373
  running on macOS Ventura hosted on Sauce Labs. The `options` hash includes options for specifying the driver name, setting
@@ -2418,7 +2418,7 @@ the following **Environment Variables** must be set as described in the table be
2418
2418
  | `DEVICE_TYPE` | Must be set to `phone` or `tablet` |
2419
2419
  | `SL_USERNAME` | Must be set to your Sauce Labs account user name or email address |
2420
2420
  | `SL_AUTHKEY` | Must be set to your Sauce Labs account access key |
2421
- | `DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
2421
+ | `SL_DATA_CENTER` | Must be set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`) |
2422
2422
  | `ORIENTATION` | [Optional] Set to `PORTRAIT` or `LANDSCAPE` |
2423
2423
 
2424
2424
 
@@ -2456,11 +2456,11 @@ When using the `options` hash, the following options and capabilities must be sp
2456
2456
 
2457
2457
  ℹ️ If an `endpoint:` is not specified in the `options` hash, then the default remote endpoint URL will be set to the following:
2458
2458
 
2459
- `https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['DATA_CENTER']}.saucelabs.com:443/wd/hub`
2459
+ `https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['SL_DATA_CENTER']}.saucelabs.com:443/wd/hub`
2460
2460
 
2461
2461
  This default endpoint requires that the `SL_USERNAME` Environment Variable is set to your Sauce Labs account user name, the
2462
- `SL_AUTHKEY` Environment Variable is set to your Sauce Labs access key, and the `DATA_CENTER` Environment Variable is set to
2463
- your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`).
2462
+ `SL_AUTHKEY` Environment Variable is set to your Sauce Labs access key, and the `SL_DATA_CENTER` Environment Variable is
2463
+ set to your Sauce Labs account Data Center assignment (`us-west-1`, `eu-central-1`, `apac-southeast-1`).
2464
2464
 
2465
2465
  Below is an example of an `options` hash for specifying a connection to a mobile Safari web browser running on an iPad
2466
2466
  tablet hosted on Sauce Labs. The `options` hash includes options for specifying the driver name, and capabilities for setting
@@ -2690,7 +2690,7 @@ When using the `options` hash, the following options and capabilities must be sp
2690
2690
  browserName: browser_name_from_chart,
2691
2691
  browserVersion: browser_version_from_chart,
2692
2692
  'LT:Options': {
2693
- userName: lt_account_user_name,
2693
+ username: lt_account_user_name,
2694
2694
  accessKey: lt_account_access_key,
2695
2695
  platformName: platformName_from_chart
2696
2696
  }
@@ -2722,7 +2722,7 @@ test configuration options.
2722
2722
  browserVersion: '119.0',
2723
2723
  'LT:Options': {
2724
2724
  platformName: 'macOS Sonoma',
2725
- userName: ENV['LT_USERNAME'],
2725
+ username: ENV['LT_USERNAME'],
2726
2726
  accessKey: ENV['LT_AUTHKEY'],
2727
2727
  project: 'ALP AP',
2728
2728
  build: "Test Build {ENV['BUILD_NUM']}",
@@ -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
@@ -2925,7 +2993,7 @@ with access to your version control system.
2925
2993
  # access to your version control system
2926
2994
  #==============
2927
2995
 
2928
- saucelabs: DRIVER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" DATA_CENTER="<INSERT DATA CENTER HERE"
2996
+ saucelabs: DRIVER=saucelabs SL_USERNAME="<INSERT USER NAME HERE>" SL_AUTHKEY="<INSERT PASSWORD HERE>" SL_DATA_CENTER="<INSERT DATA CENTER HERE"
2929
2997
  sl_desktop: --profile saucelabs <%= desktop %>
2930
2998
  sl_mobile: --profile saucelabs <%= mobile %>
2931
2999
 
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '4.4.1'
2
+ VERSION = '4.4.3'
3
3
  end
@@ -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
- Environ.browser = @capabilities[:browserName]
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.platform = :desktop
55
- Environ.headless = false
56
- Environ.device = :web
57
- Environ.device_name = 'browser'
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
@@ -571,7 +582,7 @@ module TestCentricity
571
582
  end
572
583
  # specify endpoint url
573
584
  if @endpoint.nil?
574
- @endpoint = "https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['DATA_CENTER']}.saucelabs.com:443/wd/hub"
585
+ @endpoint = "https://#{ENV['SL_USERNAME']}:#{ENV['SL_AUTHKEY']}@ondemand.#{ENV['SL_DATA_CENTER']}.saucelabs.com:443/wd/hub"
575
586
  end
576
587
  # define SauceLab options
577
588
  options = if @capabilities.nil?
@@ -642,15 +653,16 @@ module TestCentricity
642
653
  Environ.os = ENV['LT_OS']
643
654
  # define the required set of LambdaTest options
644
655
  lt_options = {
645
- user: ENV['LT_USERNAME'],
656
+ username: ENV['LT_USERNAME'],
646
657
  accessKey: ENV['LT_AUTHKEY'],
647
- build: test_context_message,
648
658
  platformName: ENV['LT_OS'],
649
659
  resolution: ENV['RESOLUTION'],
660
+ name: test_context_message,
650
661
  selenium_version: '4.13.0',
651
662
  }
652
663
  # define the optional LambdaTest options
653
- lt_options[:name] = ENV['AUTOMATE_PROJECT'] if ENV['AUTOMATE_PROJECT']
664
+ lt_options[:project] = ENV['AUTOMATE_PROJECT'] if ENV['AUTOMATE_PROJECT']
665
+ lt_options[:build] = ENV['AUTOMATE_BUILD'] if ENV['AUTOMATE_BUILD']
654
666
  lt_options[:headless] = ENV['HEADLESS'] if ENV['HEADLESS']
655
667
  lt_options[:timezone] = ENV['TIME_ZONE'] if ENV['TIME_ZONE']
656
668
  lt_options[:geoLocation] = ENV['GEO_LOCATION'] if ENV['GEO_LOCATION']
@@ -683,6 +695,15 @@ module TestCentricity
683
695
  end
684
696
  # :nocov:
685
697
 
698
+ def self.initialize_custom_driver
699
+ raise 'User-defined webdriver requires that you provide capabilities' if @capabilities.nil?
700
+ raise 'User-defined webdriver requires that you provide an endpoint' if @endpoint.nil?
701
+
702
+ Environ.browser = @capabilities[:browserName]
703
+ Environ.grid = :custom
704
+ register_remote_driver(Environ.browser, @capabilities)
705
+ end
706
+
686
707
  def self.chrome_edge_options(browser)
687
708
  options = case browser
688
709
  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.1
4
+ version: 4.4.3
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-22 00:00:00.000000000 Z
11
+ date: 2023-12-24 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/4.4.1
379
+ documentation_uri: https://www.rubydoc.info/gems/testcentricity_web
380
380
  post_install_message:
381
381
  rdoc_options: []
382
382
  require_paths: