capydash 0.3.0 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70d2bf9d0141c676e7685b951931458b7f224c210ae470de7a489b15d31018d8
4
- data.tar.gz: b29754791193c6533d4c382585c0e7c2a489afe3a776eaec42d085c5fb601003
3
+ metadata.gz: 662ebc84dbf531fdeaddb94ef755036cb5a5e94c037b0afbbe41936bea5343fb
4
+ data.tar.gz: aaf67c67740b5c589abcf9c57a1cbab1881c5f50bd0cfe088c1dce36c900e51a
5
5
  SHA512:
6
- metadata.gz: c108d0f1310b218a43150e6d9421b19086353a23487af8b9fb08e479ededa947a4bb0fb35e6cd3acd6659c3afba008f698a665aa17d59bd948f3d1188300c3c7
7
- data.tar.gz: b5e73a92af898a2ea0d1f4d876b61398084a018eb305e08427800152916ddc769d4d40966a97a552a64875d4672ce0d87969c90ec2bf93be4169448f740868ad
6
+ metadata.gz: 34929b408da5f0d03b2ee7e2ba6f88a6d9c57fb37d7570ffbf304b6622bdeb3dc368a6b59e7904b861e1b70e98ea80f33810e6d939c01dbddc61f1c039cdff03
7
+ data.tar.gz: 02eb6f644f021fe948395b7f6918090836a1aae901d1d113553fbef324f304d532cfdcc365a8ea76d95bce3dc473fcccf5388b610fc0331ceeaadaebff32a68b
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
  ![CapyDash Report](docs/capydash-demo.gif)
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 spec file, and expandable error details with backtraces.
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 hooks into RSpec automatically via `before(:suite)`, `after(:each)`, and `after(:suite)` callbacks. It collects results in memory during the run and writes a static HTML report to `capydash_report/` when the suite completes. No server, no database, no config files.
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
 
@@ -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
@@ -34,6 +34,7 @@ module CapyDash
34
34
 
35
35
  def record_example(example)
36
36
  return unless @started_at
37
+ return unless example.metadata[:type] == :system
37
38
 
38
39
  execution_result = example.execution_result
39
40
 
@@ -1,3 +1,3 @@
1
1
  module CapyDash
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capydash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damon Clark