axe-core-api 4.0.0.pre.c46720b → 4.0.0.pre.eafff01
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/axe/configuration.rb +1 -1
- data/lib/axe/core.rb +0 -1
- data/lib/webdriver_script_adapter/frame_adapter.rb +8 -42
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05dd6732abab6100dc1a840ac742d5ffdbee0730a7f9c0dc5207cf337d3d1d3e
|
4
|
+
data.tar.gz: aa16448a0eae2a9217427f19374be89d0bfa9ee045f0f3eb6dfa23dac2f6fdb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49deb7dcb5943032ff3e73c721152b6109f437640acfaa0cfb2490a80d1f6d6de22d7489fb4e919ce04b14162f29abab517cee74754d428d2c570265bb41320c
|
7
|
+
data.tar.gz: 160706f31540878a5a2c8f8aa8634c8e70894b7b8651bdf0d8450ebfd2cfa593dbe649f4062ec581f0df7dc2d0cc5e5a98e01c036e7e7c70b2ac597c1e4f209c
|
data/lib/axe/configuration.rb
CHANGED
data/lib/axe/core.rb
CHANGED
@@ -31,7 +31,6 @@ module Axe
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def wrap_driver(driver)
|
34
|
-
driver = driver.driver if driver.respond_to? :driver
|
35
34
|
::WebDriverScriptAdapter::QuerySelectorAdapter.wrap(
|
36
35
|
::WebDriverScriptAdapter::FrameAdapter.wrap(
|
37
36
|
::WebDriverScriptAdapter::ExecuteAsyncScriptAdapter.wrap(
|
@@ -3,7 +3,7 @@ require "dumb_delegator"
|
|
3
3
|
module WebDriverScriptAdapter
|
4
4
|
class FrameAdapter < ::DumbDelegator
|
5
5
|
def self.wrap(driver)
|
6
|
-
if driver.respond_to?(:
|
6
|
+
if driver.respond_to?(:within_frame)
|
7
7
|
CapybaraAdapter.new driver
|
8
8
|
elsif !driver.respond_to?(:switch_to)
|
9
9
|
WatirAdapter.new driver
|
@@ -16,19 +16,20 @@ module WebDriverScriptAdapter
|
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
|
-
class
|
20
|
-
def
|
21
|
-
|
22
|
-
@driver = driver
|
19
|
+
class CapybaraAdapter < ::DumbDelegator
|
20
|
+
def find_frames
|
21
|
+
all(:css, "iframe")
|
23
22
|
end
|
23
|
+
end
|
24
24
|
|
25
|
+
class WatirAdapter < ::DumbDelegator
|
25
26
|
# delegate to Watir's Selenium #driver
|
26
27
|
def within_frame(frame, &block)
|
27
|
-
SeleniumAdapter.instance_method(:within_frame).bind(FrameAdapter.wrap
|
28
|
+
SeleniumAdapter.instance_method(:within_frame).bind(FrameAdapter.wrap driver).call(frame, &block)
|
28
29
|
end
|
29
30
|
|
30
31
|
def find_frames
|
31
|
-
find_elements(:css, "iframe")
|
32
|
+
driver.find_elements(:css, "iframe")
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
@@ -56,41 +57,6 @@ module WebDriverScriptAdapter
|
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
59
|
-
class CapybaraAdapter < ::DumbDelegator
|
60
|
-
def initialize(driver)
|
61
|
-
super(driver)
|
62
|
-
@driver = driver
|
63
|
-
end
|
64
|
-
|
65
|
-
def within_frame(frame)
|
66
|
-
# Patch the `Symbol` class to respond to the :native method.
|
67
|
-
# Will be fixed in https://github.com/teamcapybara/capybara/pull/2462
|
68
|
-
(:parent).class.define_method(:native) do
|
69
|
-
nil
|
70
|
-
end
|
71
|
-
switch_to_frame frame
|
72
|
-
yield
|
73
|
-
ensure
|
74
|
-
begin
|
75
|
-
switch_to_frame :parent
|
76
|
-
rescue => e
|
77
|
-
if /switchToParentFrame|frame\/parent/.match(e.message)
|
78
|
-
::Kernel.warn "WARNING:
|
79
|
-
This browser only supports first-level iframes.
|
80
|
-
Second-level iframes and beyond will not be audited.
|
81
|
-
To skip auditing all iframes,
|
82
|
-
set Axe::Configuration#skip_iframes=true"
|
83
|
-
end
|
84
|
-
switch_to_frame :top
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def find_frames
|
89
|
-
find_css("iframe")
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
60
|
# Selenium Webdriver < 2.43 doesnt support moving back to the parent
|
95
61
|
class ParentlessFrameAdapter < ::DumbDelegator
|
96
62
|
# storage of frame stack (for reverting to parent) taken from Capybara
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axe-core-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.pre.
|
4
|
+
version: 4.0.0.pre.eafff01
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deque Systems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dumb_delegator
|