Skip to content

Commit 287e2b4

Browse files
committed
Axe
1 parent 23965d2 commit 287e2b4

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ group :development, :test do
3131
gem 'rspec-rails'
3232
gem 'capybara'
3333
gem 'selenium-webdriver'
34+
gem 'axe-core-rspec'
35+
gem 'axe-core-capybara'
3436
end
3537

3638
group :development do

Gemfile.lock

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ GEM
6262
zeitwerk (~> 2.3)
6363
addressable (2.7.0)
6464
public_suffix (>= 2.0.2, < 5.0)
65+
axe-core-api (4.1.0)
66+
capybara
67+
dumb_delegator
68+
selenium-webdriver
69+
virtus
70+
watir
71+
axe-core-capybara (4.1.0)
72+
axe-core-api
73+
dumb_delegator
74+
axe-core-rspec (4.1.0)
75+
axe-core-api
76+
dumb_delegator
77+
virtus
78+
axiom-types (0.1.1)
79+
descendants_tracker (~> 0.0.4)
80+
ice_nine (~> 0.11.0)
81+
thread_safe (~> 0.3, >= 0.3.1)
6582
bindex (0.8.1)
6683
bootsnap (1.7.3)
6784
msgpack (~> 1.0)
@@ -76,15 +93,22 @@ GEM
7693
regexp_parser (>= 1.5, < 3.0)
7794
xpath (~> 3.2)
7895
childprocess (3.0.0)
96+
coercible (1.0.0)
97+
descendants_tracker (~> 0.0.1)
7998
concurrent-ruby (1.1.8)
8099
crass (1.0.6)
100+
descendants_tracker (0.0.4)
101+
thread_safe (~> 0.3, >= 0.3.1)
81102
diff-lcs (1.4.4)
103+
dumb_delegator (1.0.0)
104+
equalizer (0.0.11)
82105
erubi (1.10.0)
83106
ffi (1.15.0)
84107
globalid (0.4.2)
85108
activesupport (>= 4.2.0)
86109
i18n (1.8.10)
87110
concurrent-ruby (~> 1.0)
111+
ice_nine (0.11.2)
88112
listen (3.5.1)
89113
rb-fsevent (~> 0.10, >= 0.10.3)
90114
rb-inotify (~> 0.9, >= 0.9.10)
@@ -186,12 +210,21 @@ GEM
186210
sprockets (>= 3.0.0)
187211
sqlite3 (1.4.2)
188212
thor (1.1.0)
213+
thread_safe (0.3.6)
189214
tilt (2.0.10)
190215
turbolinks (5.2.1)
191216
turbolinks-source (~> 5.2)
192217
turbolinks-source (5.2.0)
193218
tzinfo (2.0.4)
194219
concurrent-ruby (~> 1.0)
220+
virtus (1.0.5)
221+
axiom-types (~> 0.1)
222+
coercible (~> 1.0)
223+
descendants_tracker (~> 0.0, >= 0.0.3)
224+
equalizer (~> 0.0, >= 0.0.9)
225+
watir (6.19.1)
226+
regexp_parser (>= 1.2, < 3)
227+
selenium-webdriver (>= 3.142.7)
195228
web-console (4.1.0)
196229
actionview (>= 6.0.0)
197230
activemodel (>= 6.0.0)
@@ -213,6 +246,8 @@ PLATFORMS
213246
arm64-darwin-20
214247

215248
DEPENDENCIES
249+
axe-core-capybara
250+
axe-core-rspec
216251
bootsnap (>= 1.4.4)
217252
byebug
218253
capybara

spec/features/posts_index_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
it 'is valid HTML', js: true do
99
visit '/posts'
1010
expect(page).to have_content('Hello, world!')
11+
expect(page).to be_axe_clean
1112
end
1213
end

spec/rails_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
require 'capybara/rails'
1111
require 'capybara/rspec'
1212

13+
require 'axe-rspec'
14+
require 'axe-capybara'
15+
1316
# Requires supporting ruby files with custom matchers and macros, etc, in
1417
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
1518
# run as spec files by default. This means that files in spec/support that end

0 commit comments

Comments
 (0)