rails_accessibility_testing 1.5.3 โ 1.5.5
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/ARCHITECTURE.md +376 -1
- data/CHANGELOG.md +63 -1
- data/GUIDES/getting_started.md +40 -5
- data/GUIDES/system_specs_for_accessibility.md +12 -4
- data/README.md +52 -8
- data/docs_site/Gemfile.lock +89 -0
- data/docs_site/_config.yml +9 -0
- data/docs_site/_includes/header.html +1 -0
- data/docs_site/_layouts/default.html +754 -15
- data/docs_site/architecture.md +533 -0
- data/docs_site/index.md +2 -1
- data/exe/a11y_live_scanner +10 -39
- data/exe/a11y_static_scanner +333 -0
- data/lib/generators/rails_a11y/install/install_generator.rb +19 -30
- data/lib/generators/rails_a11y/install/templates/accessibility.yml.erb +39 -0
- data/lib/generators/rails_a11y/install/templates/all_pages_accessibility_spec.rb.erb +132 -45
- data/lib/rails_accessibility_testing/accessibility_helper.rb +131 -126
- data/lib/rails_accessibility_testing/checks/base_check.rb +14 -5
- data/lib/rails_accessibility_testing/checks/form_errors_check.rb +1 -1
- data/lib/rails_accessibility_testing/checks/form_labels_check.rb +6 -4
- data/lib/rails_accessibility_testing/checks/heading_check.rb +7 -15
- data/lib/rails_accessibility_testing/checks/image_alt_text_check.rb +1 -1
- data/lib/rails_accessibility_testing/checks/interactive_elements_check.rb +12 -8
- data/lib/rails_accessibility_testing/config/yaml_loader.rb +20 -0
- data/lib/rails_accessibility_testing/erb_extractor.rb +141 -0
- data/lib/rails_accessibility_testing/error_message_builder.rb +11 -6
- data/lib/rails_accessibility_testing/file_change_tracker.rb +95 -0
- data/lib/rails_accessibility_testing/line_number_finder.rb +61 -0
- data/lib/rails_accessibility_testing/rspec_integration.rb +74 -33
- data/lib/rails_accessibility_testing/shared_examples.rb +2 -0
- data/lib/rails_accessibility_testing/static_file_scanner.rb +80 -0
- data/lib/rails_accessibility_testing/static_page_adapter.rb +116 -0
- data/lib/rails_accessibility_testing/static_scanning.rb +61 -0
- data/lib/rails_accessibility_testing/version.rb +3 -1
- data/lib/rails_accessibility_testing/violation_converter.rb +80 -0
- data/lib/rails_accessibility_testing.rb +9 -1
- metadata +26 -2
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
**The RSpec + RuboCop of accessibility for Rails. Catch WCAG violations before they reach production.**
|
|
9
9
|
|
|
10
|
-
**Current Version:** 1.5.
|
|
10
|
+
**Current Version:** 1.5.5
|
|
11
11
|
|
|
12
12
|
๐ **[๐ Full Documentation](https://rayraycodes.github.io/rails-accessibility-testing/)** | [๐ป GitHub](https://github.com/rayraycodes/rails-accessibility-testing) | [๐ RubyGems](https://rubygems.org/gems/rails_accessibility_testing)
|
|
13
13
|
|
|
@@ -29,7 +29,15 @@ Rails Accessibility Testing fills a critical gap in the Rails testing ecosystem.
|
|
|
29
29
|
- ๐งช **RSpec & Minitest** - Works with both test frameworks
|
|
30
30
|
- โ๏ธ **YAML Configuration** - Profile-based config (dev/test/CI)
|
|
31
31
|
|
|
32
|
-
### ๐ Version 1.5.0 Highlights
|
|
32
|
+
### ๐ Version 1.5.0+ Highlights
|
|
33
|
+
|
|
34
|
+
#### ๐ Static File Scanner (NEW)
|
|
35
|
+
- **Fast file-based scanning**: Scans ERB templates directly without browser rendering
|
|
36
|
+
- **Smart change detection**: Only scans files that have changed since last scan
|
|
37
|
+
- **Precise error reporting**: Shows exact file locations and line numbers
|
|
38
|
+
- **Continuous monitoring**: Watches for file changes and re-scans automatically
|
|
39
|
+
- **YAML configuration**: Fully configurable via `config/accessibility.yml`
|
|
40
|
+
- **Reuses existing checks**: Leverages all 11 accessibility checks via RuleEngine
|
|
33
41
|
|
|
34
42
|
#### ๐ฏ Live Accessibility Scanner
|
|
35
43
|
- **Real-time scanning**: Automatically scans pages as you browse during development
|
|
@@ -99,7 +107,7 @@ This creates:
|
|
|
99
107
|
- `config/accessibility.yml` - Check settings
|
|
100
108
|
- `spec/system/all_pages_accessibility_spec.rb` - Comprehensive spec that dynamically tests all GET routes
|
|
101
109
|
- Updates `spec/rails_helper.rb` (if using RSpec)
|
|
102
|
-
- Updates `Procfile.dev` with
|
|
110
|
+
- Updates `Procfile.dev` with static accessibility scanner (`a11y_static_scanner`)
|
|
103
111
|
- Optionally uses `rails_server_safe` wrapper (convenience helper, not required)
|
|
104
112
|
|
|
105
113
|
### Setup (Option 2: Manual)
|
|
@@ -203,15 +211,36 @@ end
|
|
|
203
211
|
|
|
204
212
|
### Continuous Development Testing
|
|
205
213
|
|
|
206
|
-
|
|
214
|
+
The generator automatically adds a static accessibility scanner to your `Procfile.dev`:
|
|
207
215
|
|
|
208
|
-
```
|
|
209
|
-
web:
|
|
216
|
+
```procfile
|
|
217
|
+
web: bin/rails server
|
|
210
218
|
css: bin/rails dartsass:watch
|
|
211
|
-
a11y:
|
|
219
|
+
a11y: bundle exec a11y_static_scanner
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Then run:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
bin/dev
|
|
212
226
|
```
|
|
213
227
|
|
|
214
|
-
This
|
|
228
|
+
This will:
|
|
229
|
+
- Start your Rails server
|
|
230
|
+
- Watch for CSS changes
|
|
231
|
+
- **Continuously scan view files for accessibility issues** - Only scans files that have changed since last scan
|
|
232
|
+
- Shows errors with exact file locations and line numbers
|
|
233
|
+
|
|
234
|
+
**Configuration** (in `config/accessibility.yml`):
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
static_scanner:
|
|
238
|
+
scan_changed_only: true # Only scan changed files
|
|
239
|
+
check_interval: 3 # Seconds between file checks
|
|
240
|
+
full_scan_on_startup: true # Full scan on first run
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The static scanner provides fast, continuous feedback as you develop!
|
|
215
244
|
|
|
216
245
|
### CLI Usage
|
|
217
246
|
|
|
@@ -274,6 +303,19 @@ checks:
|
|
|
274
303
|
skip_links: true
|
|
275
304
|
color_contrast: false # Disabled by default (expensive)
|
|
276
305
|
|
|
306
|
+
# Summary configuration
|
|
307
|
+
summary:
|
|
308
|
+
show_summary: true
|
|
309
|
+
errors_only: false
|
|
310
|
+
show_fixes: true
|
|
311
|
+
ignore_warnings: false # Set to true to hide warnings, only show errors
|
|
312
|
+
|
|
313
|
+
# Static scanner configuration
|
|
314
|
+
static_scanner:
|
|
315
|
+
scan_changed_only: true # Only scan changed files
|
|
316
|
+
check_interval: 3 # Seconds between file checks
|
|
317
|
+
full_scan_on_startup: true # Full scan on first run
|
|
318
|
+
|
|
277
319
|
# Profile-specific configurations
|
|
278
320
|
development:
|
|
279
321
|
checks:
|
|
@@ -418,6 +460,8 @@ Rails Accessibility Testing is built with a clean, modular architecture:
|
|
|
418
460
|
- **View File Detection** - Intelligent detection of view files and partials
|
|
419
461
|
- **Change Detector** - Smart detection of file changes and their impact
|
|
420
462
|
- **Page Scanning Cache** - Prevents duplicate scans for performance
|
|
463
|
+
- **Static File Scanner** - Fast file-based scanning without browser (NEW in 1.5.3)
|
|
464
|
+
- **File Change Tracker** - Tracks file modification times for efficient change detection
|
|
421
465
|
- **Rails Integration** - Railtie, RSpec, Minitest helpers
|
|
422
466
|
- **CLI** - Command-line interface for URL/route scanning
|
|
423
467
|
- **Configuration** - YAML-based config with profiles
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
addressable (2.8.7)
|
|
5
|
+
public_suffix (>= 2.0.2, < 7.0)
|
|
6
|
+
colorator (1.1.0)
|
|
7
|
+
concurrent-ruby (1.3.5)
|
|
8
|
+
em-websocket (0.5.3)
|
|
9
|
+
eventmachine (>= 0.12.9)
|
|
10
|
+
http_parser.rb (~> 0)
|
|
11
|
+
eventmachine (1.2.7)
|
|
12
|
+
ffi (1.17.2)
|
|
13
|
+
forwardable-extended (2.6.0)
|
|
14
|
+
google-protobuf (3.23.4)
|
|
15
|
+
http_parser.rb (0.8.0)
|
|
16
|
+
i18n (1.14.7)
|
|
17
|
+
concurrent-ruby (~> 1.0)
|
|
18
|
+
jekyll (4.3.4)
|
|
19
|
+
addressable (~> 2.4)
|
|
20
|
+
colorator (~> 1.0)
|
|
21
|
+
em-websocket (~> 0.5)
|
|
22
|
+
i18n (~> 1.0)
|
|
23
|
+
jekyll-sass-converter (>= 2.0, < 4.0)
|
|
24
|
+
jekyll-watch (~> 2.0)
|
|
25
|
+
kramdown (~> 2.3, >= 2.3.1)
|
|
26
|
+
kramdown-parser-gfm (~> 1.0)
|
|
27
|
+
liquid (~> 4.0)
|
|
28
|
+
mercenary (>= 0.3.6, < 0.5)
|
|
29
|
+
pathutil (~> 0.9)
|
|
30
|
+
rouge (>= 3.0, < 5.0)
|
|
31
|
+
safe_yaml (~> 1.0)
|
|
32
|
+
terminal-table (>= 1.8, < 4.0)
|
|
33
|
+
webrick (~> 1.7)
|
|
34
|
+
jekyll-feed (0.17.0)
|
|
35
|
+
jekyll (>= 3.7, < 5.0)
|
|
36
|
+
jekyll-relative-links (0.7.0)
|
|
37
|
+
jekyll (>= 3.3, < 5.0)
|
|
38
|
+
jekyll-sass-converter (3.0.0)
|
|
39
|
+
sass-embedded (~> 1.54)
|
|
40
|
+
jekyll-seo-tag (2.8.0)
|
|
41
|
+
jekyll (>= 3.8, < 5.0)
|
|
42
|
+
jekyll-sitemap (1.4.0)
|
|
43
|
+
jekyll (>= 3.7, < 5.0)
|
|
44
|
+
jekyll-watch (2.2.1)
|
|
45
|
+
listen (~> 3.0)
|
|
46
|
+
kramdown (2.5.1)
|
|
47
|
+
rexml (>= 3.3.9)
|
|
48
|
+
kramdown-parser-gfm (1.1.0)
|
|
49
|
+
kramdown (~> 2.0)
|
|
50
|
+
liquid (4.0.4)
|
|
51
|
+
listen (3.9.0)
|
|
52
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
53
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
54
|
+
mercenary (0.4.0)
|
|
55
|
+
minima (2.5.1)
|
|
56
|
+
jekyll (>= 3.5, < 5.0)
|
|
57
|
+
jekyll-feed (~> 0.9)
|
|
58
|
+
jekyll-seo-tag (~> 2.1)
|
|
59
|
+
pathutil (0.16.2)
|
|
60
|
+
forwardable-extended (~> 2.6)
|
|
61
|
+
public_suffix (5.1.1)
|
|
62
|
+
rake (13.3.1)
|
|
63
|
+
rb-fsevent (0.11.2)
|
|
64
|
+
rb-inotify (0.11.1)
|
|
65
|
+
ffi (~> 1.0)
|
|
66
|
+
rexml (3.4.4)
|
|
67
|
+
rouge (3.30.0)
|
|
68
|
+
safe_yaml (1.0.5)
|
|
69
|
+
sass-embedded (1.58.3)
|
|
70
|
+
google-protobuf (~> 3.21)
|
|
71
|
+
rake (>= 10.0.0)
|
|
72
|
+
terminal-table (3.0.2)
|
|
73
|
+
unicode-display_width (>= 1.1.1, < 3)
|
|
74
|
+
unicode-display_width (2.6.0)
|
|
75
|
+
webrick (1.9.1)
|
|
76
|
+
|
|
77
|
+
PLATFORMS
|
|
78
|
+
ruby
|
|
79
|
+
|
|
80
|
+
DEPENDENCIES
|
|
81
|
+
jekyll (~> 4.3)
|
|
82
|
+
jekyll-feed (~> 0.12)
|
|
83
|
+
jekyll-relative-links (~> 0.7)
|
|
84
|
+
jekyll-sitemap (~> 1.4)
|
|
85
|
+
minima (~> 2.5)
|
|
86
|
+
webrick (~> 1.7)
|
|
87
|
+
|
|
88
|
+
BUNDLED WITH
|
|
89
|
+
1.17.2
|
data/docs_site/_config.yml
CHANGED
|
@@ -17,12 +17,21 @@ markdown: kramdown
|
|
|
17
17
|
highlighter: rouge
|
|
18
18
|
theme: minima
|
|
19
19
|
|
|
20
|
+
# Kramdown settings for Mermaid support
|
|
21
|
+
kramdown:
|
|
22
|
+
syntax_highlighter: rouge
|
|
23
|
+
syntax_highlighter_opts:
|
|
24
|
+
disable: false
|
|
25
|
+
input: GFM
|
|
26
|
+
|
|
20
27
|
# Navigation
|
|
21
28
|
navigation:
|
|
22
29
|
- title: Home
|
|
23
30
|
url: /
|
|
24
31
|
- title: Getting Started
|
|
25
32
|
url: /getting_started.html
|
|
33
|
+
- title: Architecture
|
|
34
|
+
url: /architecture.html
|
|
26
35
|
- title: Configuration
|
|
27
36
|
url: /configuration.html
|
|
28
37
|
- title: CI Integration
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<nav>
|
|
7
7
|
<a href="{{ '/' | relative_url }}">Home</a>
|
|
8
8
|
<a href="{{ '/getting_started.html' | relative_url }}">Getting Started</a>
|
|
9
|
+
<a href="{{ '/architecture.html' | relative_url }}">Architecture</a>
|
|
9
10
|
<a href="{{ '/configuration.html' | relative_url }}">Configuration</a>
|
|
10
11
|
<a href="{{ '/ci_integration.html' | relative_url }}">CI Integration</a>
|
|
11
12
|
<a href="{{ '/contributing.html' | relative_url }}">Contributing</a>
|