capydash 0.3.0 → 0.3.1
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 +23 -4
- data/lib/capydash/minitest.rb +7 -0
- data/lib/capydash/rspec.rb +1 -0
- data/lib/capydash/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59bf6aaa616cf19064f4fc9d98b53f81fc79f54ef604c2034636f6ea8dbf936d
|
|
4
|
+
data.tar.gz: 605412b29c494e55a96eb8a79293e2bd4b68cf06f3c6fbb0f0be7efbf1e362d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 496f1563f50549166ae3ff4a0e31fce18941522401bc9aa0a83076907a9996238d9102896857aabf8ecf813a92a89b9daeb9d25753ff097ea966cd5b4b2509a4
|
|
7
|
+
data.tar.gz: c070c748dbbe64238712368702279a49bb2a5c0c6af4635916b5e39308b8d81ddf92dda24b9369517c52fa48a48937b810b0901044b6c98820eac062d002fcb5
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CapyDash
|
|
2
2
|
|
|
3
|
-
Minimal, zero-config HTML report for your RSpec tests. Add the gem, run your tests, get a report.
|
|
3
|
+
Minimal, zero-config HTML report for your RSpec and Minitest tests. Add the gem, run your tests, get a report.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -21,7 +21,12 @@ Run `bundle install`. That's it — no configuration needed.
|
|
|
21
21
|
Run your tests as usual:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
+
# RSpec
|
|
24
25
|
bundle exec rspec
|
|
26
|
+
|
|
27
|
+
# Minitest
|
|
28
|
+
bundle exec rails test
|
|
29
|
+
bundle exec rails test:system
|
|
25
30
|
```
|
|
26
31
|
|
|
27
32
|
After the suite finishes, open the generated report:
|
|
@@ -30,16 +35,30 @@ After the suite finishes, open the generated report:
|
|
|
30
35
|
capydash_report/index.html
|
|
31
36
|
```
|
|
32
37
|
|
|
33
|
-
The report includes pass/fail counts, tests grouped by
|
|
38
|
+
The report includes pass/fail counts, tests grouped by class, expandable error details with backtraces, and failure screenshots with a clickable lightbox.
|
|
39
|
+
|
|
40
|
+
## Failure Screenshots
|
|
41
|
+
|
|
42
|
+
When a test fails and Capybara with a browser driver is available, CapyDash automatically captures a screenshot and embeds it in the report. Click the thumbnail to view the full-size image.
|
|
43
|
+
|
|
44
|
+
- **RSpec** — screenshot captured during `after(:each)`, before session teardown
|
|
45
|
+
- **Minitest** — uses Rails' built-in failure screenshot from `tmp/capybara/`
|
|
46
|
+
|
|
47
|
+
No configuration needed. If Capybara isn't available, screenshots are silently skipped.
|
|
34
48
|
|
|
35
49
|
## Requirements
|
|
36
50
|
|
|
37
|
-
- RSpec >= 3.0
|
|
51
|
+
- RSpec >= 3.0 **or** Minitest >= 5.0
|
|
38
52
|
- Ruby 2.7+
|
|
39
53
|
|
|
40
54
|
## How It Works
|
|
41
55
|
|
|
42
|
-
CapyDash
|
|
56
|
+
CapyDash auto-detects your test framework and hooks in automatically:
|
|
57
|
+
|
|
58
|
+
- **RSpec** — registers `before(:suite)`, `after(:each)`, and `after(:suite)` callbacks via `RSpec.configure`
|
|
59
|
+
- **Minitest** — registers a reporter via the [Minitest plugin system](https://docs.seattlerb.org/minitest/Minitest.html) (`start`, `record`, `report`)
|
|
60
|
+
|
|
61
|
+
Results are collected in memory during the run and written as a static HTML report to `capydash_report/` when the suite completes. Each run produces a fresh report — no server, no database, no config files.
|
|
43
62
|
|
|
44
63
|
## License
|
|
45
64
|
|
data/lib/capydash/minitest.rb
CHANGED
|
@@ -11,6 +11,7 @@ module CapyDash
|
|
|
11
11
|
|
|
12
12
|
def record(result)
|
|
13
13
|
return unless @started_at
|
|
14
|
+
return unless system_test?(result)
|
|
14
15
|
|
|
15
16
|
status = if result.skipped?
|
|
16
17
|
'pending'
|
|
@@ -61,6 +62,12 @@ module CapyDash
|
|
|
61
62
|
|
|
62
63
|
private
|
|
63
64
|
|
|
65
|
+
def system_test?(result)
|
|
66
|
+
return false unless defined?(::ActionDispatch::SystemTestCase)
|
|
67
|
+
klass = Object.const_get(result.klass) rescue nil
|
|
68
|
+
klass && klass <= ::ActionDispatch::SystemTestCase
|
|
69
|
+
end
|
|
70
|
+
|
|
64
71
|
def find_rails_screenshot(test_name)
|
|
65
72
|
path = File.join(Dir.pwd, "tmp", "capybara", "failures_#{test_name}.png")
|
|
66
73
|
File.exist?(path) ? path : nil
|
data/lib/capydash/rspec.rb
CHANGED
data/lib/capydash/version.rb
CHANGED