async-webdriver 0.4.0 → 0.5.0

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: 2885f18a964ec45c687168efd25b89326eb2a7cdf30e2458a8d348a6613d22ff
4
- data.tar.gz: 58de67040f73f43aa73e2877acab7c7637575721613d63941127bb69a38e3899
3
+ metadata.gz: da08a7e4f4e91c945652030f4616b76e9b087cc84efb98f6ee48c99504407abc
4
+ data.tar.gz: bf78251edf46c21d60b73adfa60b3105a9c114a9c0de26454ca59ed1cba85198
5
5
  SHA512:
6
- metadata.gz: ddfea03fb616984f3f48d2bf6199918119c6750a84e53f012d9d3e3a9c6231508cb911578c19cfd7cd7a88a4fe15965d5a8a8502fd7fc3148af0c8aa409f1fd1
7
- data.tar.gz: 7a309bf300d64898d622da707e9fa98e37876cd1752e9ce749b45ed74d0648b7d3f5030d3bad9b123f5bfec468faee57271c45e596af7936868acc34c62fa4b4
6
+ metadata.gz: 79921aa72ebc306b70a5615de0aec9b2ffa5e6c56186f08ce781b69837f71911334512148678320da898dcf546f310de9157e554ee65a00bd37b05f6584f6303
7
+ data.tar.gz: 7f193306b1552c179a96b8d2ca832b979d6118bea9c8c9a22da5550e454de1b3282605486191727ed5af7cd3eb674c0b231bb8aad82b84f7ad353c08f5c23adf
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
6
  require_relative 'generic'
7
7
  require_relative 'process_group'
@@ -71,7 +71,7 @@ module Async
71
71
  # The default capabilities for the Chrome browser which need to be provided when requesting a new session.
72
72
  # @parameter headless [Boolean] Whether to run the browser in headless mode.
73
73
  # @returns [Hash] The default capabilities for the Chrome browser.
74
- def default_capabilities(headless: true)
74
+ def default_capabilities(headless: self.headless?)
75
75
  {
76
76
  alwaysMatch: {
77
77
  browserName: "chrome",
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
6
  require_relative 'generic'
7
7
  require_relative 'process_group'
@@ -74,7 +74,7 @@ module Async
74
74
  # The default capabilities for the Firefox browser which need to be provided when requesting a new session.
75
75
  # @parameter headless [Boolean] Whether to run the browser in headless mode.
76
76
  # @returns [Hash] The default capabilities for the Firefox browser.
77
- def default_capabilities(headless: true)
77
+ def default_capabilities(headless: self.headless?)
78
78
  {
79
79
  alwaysMatch: {
80
80
  browserName: "firefox",
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
6
  require 'socket'
7
7
  require 'async/http/endpoint'
@@ -29,6 +29,10 @@ module Async
29
29
  def supported?
30
30
  version != nil
31
31
  end
32
+
33
+ def headless?
34
+ @options.fetch(:headless, true)
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2024, by Samuel Williams.
5
5
 
6
6
  require_relative 'bridge/chrome'
7
7
  require_relative 'bridge/firefox'
@@ -36,16 +36,27 @@ module Async
36
36
  # ```
37
37
  ASYNC_WEBDRIVER_BRIDGE = 'ASYNC_WEBDRIVER_BRIDGE'
38
38
 
39
+ # The environment variable used to disable headless mode.
40
+ #
41
+ # ```
42
+ # ASYNC_WEBDRIVER_BRIDGE_HEADLESS=false
43
+ # ```
44
+ ASYNC_WEBDRIVER_BRIDGE_HEADLESS = 'ASYNC_WEBDRIVER_BRIDGE_HEADLESS'
45
+
39
46
  class UnsupportedError < Error
40
47
  end
41
48
 
42
49
  # @returns [Bridge] The default bridge to use.
43
- def self.default(env = ENV)
50
+ def self.default(env = ENV, **options)
51
+ if env[ASYNC_WEBDRIVER_BRIDGE_HEADLESS] == "false"
52
+ options[:headless] = false
53
+ end
54
+
44
55
  if name = env[ASYNC_WEBDRIVER_BRIDGE]
45
- self.const_get(name).new
56
+ self.const_get(name).mew(**options)
46
57
  else
47
58
  ALL.each do |klass|
48
- instance = klass.new
59
+ instance = klass.new(**options)
49
60
  return instance if instance.supported?
50
61
  end
51
62
 
@@ -3,8 +3,6 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2023, by Samuel Williams.
5
5
 
6
- require 'base64'
7
-
8
6
  module Async
9
7
  module WebDriver
10
8
  # A locator is used to find elements in the DOM.
@@ -3,8 +3,6 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2023, by Samuel Williams.
5
5
 
6
- require 'base64'
7
-
8
6
  module Async
9
7
  module WebDriver
10
8
  module Scope
@@ -3,8 +3,6 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2023, by Samuel Williams.
5
5
 
6
- require 'base64'
7
-
8
6
  require_relative '../xpath'
9
7
 
10
8
  module Async
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module WebDriver
8
- VERSION = "0.4.0"
8
+ VERSION = "0.5.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2023, by Samuel Williams.
3
+ Copyright, 2023-2024, by Samuel Williams.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -18,6 +18,10 @@ Please see the [project documentation](https://socketry.github.io/async-webdrive
18
18
 
19
19
  - [GitHub Actions Integrations](https://socketry.github.io/async-webdriver/guides/github-actions-integration/index) - This guide explains how to use `async-webdriver` with GitHub Actions.
20
20
 
21
+ ## See Also
22
+
23
+ - [sus-fixtures-async-webdriver](https://github.com/socketry/sus-fixtures-async-webdriver) - STandard fixtures for testing web applications with `async-webdriver`.
24
+
21
25
  ## Contributing
22
26
 
23
27
  We welcome contributions to this project.
@@ -34,4 +38,4 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
34
38
 
35
39
  ### Contributor Covenant
36
40
 
37
- This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
41
+ This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,8 +37,22 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2023-12-08 00:00:00.000000000 Z
40
+ date: 2024-05-04 00:00:00.000000000 Z
41
41
  dependencies:
42
+ - !ruby/object:Gem::Dependency
43
+ name: async-actor
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.1'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.1'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: async-http
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -54,47 +68,47 @@ dependencies:
54
68
  - !ruby/object:Gem::Version
55
69
  version: '0.61'
56
70
  - !ruby/object:Gem::Dependency
57
- name: async-websocket
71
+ name: async-pool
58
72
  requirement: !ruby/object:Gem::Requirement
59
73
  requirements:
60
74
  - - "~>"
61
75
  - !ruby/object:Gem::Version
62
- version: '0.25'
76
+ version: '0.4'
63
77
  type: :runtime
64
78
  prerelease: false
65
79
  version_requirements: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - "~>"
68
82
  - !ruby/object:Gem::Version
69
- version: '0.25'
83
+ version: '0.4'
70
84
  - !ruby/object:Gem::Dependency
71
- name: async-actor
85
+ name: async-websocket
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
88
  - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: '0.1'
90
+ version: '0.25'
77
91
  type: :runtime
78
92
  prerelease: false
79
93
  version_requirements: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: '0.1'
97
+ version: '0.25'
84
98
  - !ruby/object:Gem::Dependency
85
- name: async-pool
99
+ name: base64
86
100
  requirement: !ruby/object:Gem::Requirement
87
101
  requirements:
88
102
  - - "~>"
89
103
  - !ruby/object:Gem::Version
90
- version: '0.4'
104
+ version: '0.2'
91
105
  type: :runtime
92
106
  prerelease: false
93
107
  version_requirements: !ruby/object:Gem::Requirement
94
108
  requirements:
95
109
  - - "~>"
96
110
  - !ruby/object:Gem::Version
97
- version: '0.4'
111
+ version: '0.2'
98
112
  description:
99
113
  email:
100
114
  executables: []
@@ -130,12 +144,13 @@ files:
130
144
  - lib/async/webdriver/xpath.rb
131
145
  - license.md
132
146
  - readme.md
133
- homepage: https://github.com/socketry/async-webdriver/
147
+ homepage: https://github.com/socketry/async-webdriver
134
148
  licenses:
135
149
  - MIT
136
150
  metadata:
137
151
  documentation_uri: https://socketry.github.io/async-webdriver/
138
152
  funding_uri: https://github.com/sponsors/ioquatix
153
+ source_code_uri: https://github.com/socketry/async-webdriver.git
139
154
  post_install_message:
140
155
  rdoc_options: []
141
156
  require_paths:
@@ -144,14 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
159
  requirements:
145
160
  - - ">="
146
161
  - !ruby/object:Gem::Version
147
- version: '3.0'
162
+ version: '3.1'
148
163
  required_rubygems_version: !ruby/object:Gem::Requirement
149
164
  requirements:
150
165
  - - ">="
151
166
  - !ruby/object:Gem::Version
152
167
  version: '0'
153
168
  requirements: []
154
- rubygems_version: 3.4.22
169
+ rubygems_version: 3.5.3
155
170
  signing_key:
156
171
  specification_version: 4
157
172
  summary: A native library implementing the W3C WebDriver client specification.
metadata.gz.sig CHANGED
Binary file