axe-core-selenium 4.10.2.pre.a5ec13e → 4.10.2.pre.720be7c
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/README.md +15 -4
- data/lib/axe-selenium.rb +6 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73226ce3031647cc85a56cdbf220f6a6f0d832409953ffedc916820773a617ec
|
4
|
+
data.tar.gz: 179c0973fd159cf9fcbd0df68d2a3598b1f0fd458108dc2cc10a8ddb441099d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a335bfb68178880920bf368c2b66972273cbef943ac1b7af5241231368b50e7d0115e70fd1a3142658991bbc22311f0eba8c5b87d6bcae3f01b0b79314559f39
|
7
|
+
data.tar.gz: 52ef20d32f9571f8fb3ac70ae916ccb31e6a901432aa5798ba4925f6e1957bffde433029534c32c2b1c1c9fa3ca2b34436d21bbad0f3eb9a119dea1ccd605b59
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ require 'axe-selenium'
|
|
20
20
|
# configure `AxeSelenium`
|
21
21
|
|
22
22
|
driver = AxeSelenium.configure(:firefox) do |c|
|
23
|
-
# see below for a full list of configuration
|
23
|
+
# see below for a full list of configuration
|
24
24
|
c.jslib_path = "next-version/axe.js"
|
25
25
|
end
|
26
26
|
|
@@ -28,7 +28,18 @@ end
|
|
28
28
|
driver.page.navigate.to 'https://www.deque.com/'
|
29
29
|
```
|
30
30
|
|
31
|
-
|
31
|
+
Custom options can be passed to the underlying driver:
|
32
|
+
|
33
|
+
```rb
|
34
|
+
require 'axe-selenium'
|
35
|
+
|
36
|
+
options = Selenium::WebDriver::Options.firefox
|
37
|
+
options.args << '-headless'
|
38
|
+
|
39
|
+
driver = AxeSelenium.configure(:firefox, options) {}
|
40
|
+
```
|
41
|
+
|
42
|
+
### API
|
32
43
|
|
33
44
|
#### `AxeSelenium.configure`
|
34
45
|
|
@@ -36,7 +47,7 @@ The configure method takes 1 optional argument as a [symbol][] and a configurati
|
|
36
47
|
|
37
48
|
The optional argument is a browser name for `selenium-webdriver`. The valid browser names are:
|
38
49
|
- `:firefox` (default)
|
39
|
-
- `:chrome`
|
50
|
+
- `:chrome`
|
40
51
|
- `:safari`
|
41
52
|
|
42
53
|
> Note: Please ensure respective drivers (eg: [`geckodriver`][]) are installed in your machine.
|
@@ -67,4 +78,4 @@ bundle exec rspec
|
|
67
78
|
[axe API]: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md
|
68
79
|
[Selenium Webdriver]: https://rubygems.org/gems/selenium-webdriver
|
69
80
|
[`geckodriver`]: https://github.com/mozilla/geckodriver/releases
|
70
|
-
[symbol]: https://ruby-doc.org/core-2.5.0/Symbol.html
|
81
|
+
[symbol]: https://ruby-doc.org/core-2.5.0/Symbol.html
|
data/lib/axe-selenium.rb
CHANGED
@@ -4,9 +4,10 @@ require "axe/configuration"
|
|
4
4
|
module AxeSelenium
|
5
5
|
# configure method
|
6
6
|
# - which takes an optional argument browser
|
7
|
+
# - an optional options (sic) object to configure the underlying driver
|
7
8
|
# - and a configuration block optional for Axe
|
8
|
-
def self.configure(browser = :firefox)
|
9
|
-
# instantiate axe configuration (singleton) with defaults or given config
|
9
|
+
def self.configure(browser = :firefox, opts = nil)
|
10
|
+
# instantiate axe configuration (singleton) with defaults or given config: opts
|
10
11
|
if !block_given?
|
11
12
|
raise Exception.new "Please provide a configure block for AxeSelenium"
|
12
13
|
end
|
@@ -14,7 +15,7 @@ module AxeSelenium
|
|
14
15
|
config = Axe::Configuration.instance
|
15
16
|
|
16
17
|
# provide a selenium webdriver page object
|
17
|
-
config.page = get_driver(browser)
|
18
|
+
config.page = get_driver(browser, opts)
|
18
19
|
|
19
20
|
# await and return
|
20
21
|
yield config
|
@@ -23,7 +24,7 @@ module AxeSelenium
|
|
23
24
|
|
24
25
|
private
|
25
26
|
|
26
|
-
def self.get_driver(browserSymbol)
|
27
|
-
|
27
|
+
def self.get_driver(browserSymbol, opts)
|
28
|
+
Selenium::WebDriver.for browserSymbol, options: opts
|
28
29
|
end
|
29
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axe-core-selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.10.2.pre.
|
4
|
+
version: 4.10.2.pre.720be7c
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deque Systems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dumb_delegator
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.10.2.pre.
|
33
|
+
version: 4.10.2.pre.720be7c
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.10.2.pre.
|
40
|
+
version: 4.10.2.pre.720be7c
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|