capydash 0.2.0 → 0.2.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 +4 -4
- data/README.md +70 -171
- data/capydash.gemspec +7 -13
- data/lib/capydash/rspec.rb +567 -0
- data/lib/capydash/templates/report.html.erb +7 -24
- data/lib/capydash/version.rb +2 -2
- data/lib/capydash.rb +10 -59
- metadata +13 -84
- data/lib/capydash/auth.rb +0 -103
- data/lib/capydash/configuration.rb +0 -186
- data/lib/capydash/dashboard_server.rb +0 -167
- data/lib/capydash/engine.rb +0 -52
- data/lib/capydash/error_handler.rb +0 -101
- data/lib/capydash/event_emitter.rb +0 -29
- data/lib/capydash/forwarder.rb +0 -78
- data/lib/capydash/instrumentation.rb +0 -153
- data/lib/capydash/logger.rb +0 -99
- data/lib/capydash/persistence.rb +0 -134
- data/lib/capydash/report_generator.rb +0 -1007
- data/lib/capydash/rspec_integration.rb +0 -285
- data/lib/capydash/test_data_aggregator.rb +0 -221
- data/lib/capydash/test_data_collector.rb +0 -58
- data/lib/generators/capydash/install_generator.rb +0 -124
- data/lib/tasks/capydash.rake +0 -67
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb913ca0b0dce3912a15dd5eb2f1fd2673671771ff34b485f4b1c5567240faa7
|
|
4
|
+
data.tar.gz: '0794e75f2f6d2d3c6e50cb0d49370c71d7f571c87a93519fc04947ff16c3c71b'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 153585a1af8f9ef4415a509a53c265f552bdfc496ae20409f38ce850e09624259211f53af41e13ad59bb4384936df2cdaeab3a83aab34e22dece0401fd1b4b57
|
|
7
|
+
data.tar.gz: 6079967d5cb84f6d3867a5d8ae6a996df16c8db45a800811e0c218a3d954a6615a86aea31fed07cdb2a92f0629a5d0c8e1a5eebecf0ac880af5ed4bc09307e77
|
data/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# CapyDash
|
|
2
2
|
|
|
3
|
-
A static HTML
|
|
3
|
+
A minimal static HTML report generator for RSpec system tests. CapyDash automatically generates a clean, readable test report after your RSpec suite finishes.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ **Automatic report generation** - No configuration needed
|
|
8
|
+
- ✅ **RSpec system test support** - Works out of the box with `rspec-rails`
|
|
9
|
+
- ✅ **Clean HTML reports** - Simple, readable test results
|
|
10
|
+
- ✅ **Error details** - Full exception messages and backtraces
|
|
11
|
+
- ✅ **Zero configuration** - Just add the gem and run your tests
|
|
4
12
|
|
|
5
13
|
## Installation
|
|
6
14
|
|
|
@@ -8,237 +16,128 @@ Add to your Gemfile:
|
|
|
8
16
|
|
|
9
17
|
```ruby
|
|
10
18
|
gem "capydash"
|
|
19
|
+
gem "rspec-rails"
|
|
11
20
|
```
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
Then run:
|
|
14
23
|
|
|
15
24
|
```bash
|
|
16
|
-
bundle
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Setup
|
|
20
|
-
|
|
21
|
-
### One-Command Installation
|
|
22
|
-
|
|
23
|
-
After adding CapyDash to your Gemfile and running `bundle install`, simply run:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
bundle exec rails generate capydash:install
|
|
25
|
+
bundle install
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
This will automatically:
|
|
30
|
-
- ✅ Create the CapyDash initializer
|
|
31
|
-
- ✅ Update your test helper with all necessary hooks
|
|
32
|
-
- ✅ Add rake tasks for report generation
|
|
33
|
-
- ✅ Works with parallel testing out of the box
|
|
34
|
-
|
|
35
|
-
### Manual Setup (Alternative)
|
|
36
|
-
|
|
37
|
-
If you prefer to set up CapyDash manually, see the [Manual Setup Guide](#manual-setup) below.
|
|
38
|
-
|
|
39
28
|
## Usage
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Run your tests normally - CapyDash will automatically instrument them:
|
|
30
|
+
That's it! CapyDash automatically hooks into RSpec when it detects it. Just run your tests:
|
|
44
31
|
|
|
45
32
|
```bash
|
|
46
|
-
bundle exec
|
|
33
|
+
bundle exec rspec
|
|
47
34
|
```
|
|
48
35
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
After running your Capybara tests, generate a static HTML report:
|
|
36
|
+
After your test suite completes, CapyDash will automatically generate a report at:
|
|
52
37
|
|
|
53
|
-
```bash
|
|
54
|
-
bundle exec rake capydash:report
|
|
55
38
|
```
|
|
56
|
-
|
|
57
|
-
This will create a `capydash_report/index.html` file with:
|
|
58
|
-
- Test steps in chronological order
|
|
59
|
-
- Embedded screenshots for each step
|
|
60
|
-
- Click-to-open/close functionality for screenshots
|
|
61
|
-
- Typeahead search across test names, step text, and pass/fail status
|
|
62
|
-
- Summary statistics
|
|
63
|
-
|
|
64
|
-
### View Report in Browser
|
|
65
|
-
|
|
66
|
-
**Option 1: Open directly in browser**
|
|
67
|
-
```bash
|
|
68
|
-
open capydash_report/index.html
|
|
39
|
+
capydash_report/index.html
|
|
69
40
|
```
|
|
70
41
|
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
bundle exec rake capydash:server
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Then open `http://localhost:4000` in your browser.
|
|
77
|
-
|
|
78
|
-
## Troubleshooting
|
|
79
|
-
|
|
80
|
-
### Common Issues
|
|
81
|
-
|
|
82
|
-
1. **"No test data found"**: Make sure you've added the test helper configuration and are running actual Capybara tests (not just unit tests).
|
|
83
|
-
|
|
84
|
-
2. **"log shifting failed" error**: This is a Rails logger issue, not related to CapyDash. It's harmless but you can fix it by updating your Rails version.
|
|
42
|
+
Open it in your browser to view the results.
|
|
85
43
|
|
|
86
|
-
|
|
44
|
+
## Example Test
|
|
87
45
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
5. **"No test data found"**: Make sure you're running system tests that use Capybara methods. CapyDash works with parallel testing by default.
|
|
91
|
-
|
|
92
|
-
### Example Test
|
|
93
|
-
|
|
94
|
-
Here's an example test that will work with CapyDash:
|
|
46
|
+
Here's an example RSpec system test:
|
|
95
47
|
|
|
96
48
|
```ruby
|
|
97
|
-
require '
|
|
98
|
-
|
|
99
|
-
class HomepageTest < ActionDispatch::IntegrationTest
|
|
100
|
-
include Capybara::DSL
|
|
49
|
+
require 'rails_helper'
|
|
101
50
|
|
|
102
|
-
|
|
51
|
+
RSpec.describe "Homepage", type: :system do
|
|
52
|
+
it "displays the welcome message" do
|
|
103
53
|
visit "/"
|
|
104
|
-
|
|
54
|
+
expect(page).to have_content("Welcome")
|
|
55
|
+
end
|
|
105
56
|
|
|
57
|
+
it "allows user to submit a form" do
|
|
58
|
+
visit "/"
|
|
106
59
|
fill_in "Your name", with: "Alice"
|
|
107
60
|
click_button "Greet"
|
|
108
|
-
|
|
61
|
+
expect(page).to have_content("Hello, Alice!")
|
|
109
62
|
end
|
|
110
63
|
end
|
|
111
64
|
```
|
|
112
65
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
If you prefer to set up CapyDash manually instead of using the generator:
|
|
116
|
-
|
|
117
|
-
### Step 1: Create CapyDash Initializer
|
|
66
|
+
## Report Features
|
|
118
67
|
|
|
119
|
-
|
|
68
|
+
The generated report includes:
|
|
120
69
|
|
|
121
|
-
|
|
122
|
-
|
|
70
|
+
- **Summary statistics** - Total, passed, and failed test counts
|
|
71
|
+
- **Test grouping** - Tests organized by spec file
|
|
72
|
+
- **Expandable test details** - Click to view error messages
|
|
73
|
+
- **Error information** - Full exception messages and backtraces
|
|
74
|
+
- **Clean design** - Simple, readable HTML layout
|
|
123
75
|
|
|
124
|
-
|
|
125
|
-
CapyDash.configure do |config|
|
|
126
|
-
config.port = 4000
|
|
127
|
-
config.screenshot_path = "tmp/capydash_screenshots"
|
|
128
|
-
end
|
|
76
|
+
## Requirements
|
|
129
77
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
CapyDash::TestDataAggregator.handle_event(event)
|
|
134
|
-
end
|
|
135
|
-
```
|
|
78
|
+
- Ruby 2.7+
|
|
79
|
+
- RSpec 3.0+
|
|
80
|
+
- Rails 6.0+ (for system tests)
|
|
136
81
|
|
|
137
|
-
|
|
82
|
+
## How It Works
|
|
138
83
|
|
|
139
|
-
|
|
84
|
+
1. CapyDash automatically detects when RSpec is present
|
|
85
|
+
2. Hooks into RSpec's `before(:suite)`, `after(:each)`, and `after(:suite)` callbacks
|
|
86
|
+
3. Collects test results in memory during the test run
|
|
87
|
+
4. Generates a static HTML report after all tests complete
|
|
88
|
+
5. Saves the report to `capydash_report/index.html`
|
|
140
89
|
|
|
141
|
-
|
|
142
|
-
require 'capydash'
|
|
143
|
-
|
|
144
|
-
# Start test run data collection
|
|
145
|
-
CapyDash::TestDataCollector.start_test_run
|
|
90
|
+
## Troubleshooting
|
|
146
91
|
|
|
147
|
-
|
|
148
|
-
module CapyDash
|
|
149
|
-
module TestHooks
|
|
150
|
-
def run(&block)
|
|
151
|
-
# Set the current test name for CapyDash
|
|
152
|
-
CapyDash.current_test = self.name
|
|
92
|
+
### Report not generated
|
|
153
93
|
|
|
154
|
-
|
|
155
|
-
|
|
94
|
+
- Make sure you're running RSpec tests (not Minitest)
|
|
95
|
+
- Ensure `rspec-rails` is in your Gemfile
|
|
96
|
+
- Check that tests actually ran (no early exits)
|
|
156
97
|
|
|
157
|
-
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
end
|
|
98
|
+
### Tests not appearing in report
|
|
161
99
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
prepend CapyDash::TestHooks
|
|
165
|
-
end
|
|
100
|
+
- Verify you're using RSpec system tests (`type: :system`)
|
|
101
|
+
- Make sure the test suite completed (not interrupted)
|
|
166
102
|
|
|
167
|
-
|
|
168
|
-
Minitest.after_run do
|
|
169
|
-
CapyDash::TestDataCollector.finish_test_run
|
|
170
|
-
CapyDash::TestDataAggregator.finish_test_run
|
|
171
|
-
end
|
|
172
|
-
```
|
|
103
|
+
### Report shows old results
|
|
173
104
|
|
|
174
|
-
|
|
105
|
+
- Delete the `capydash_report` directory and run tests again
|
|
106
|
+
- The report is regenerated on each test run
|
|
175
107
|
|
|
176
|
-
|
|
108
|
+
## Development
|
|
177
109
|
|
|
178
|
-
|
|
179
|
-
namespace :capydash do
|
|
180
|
-
desc "Generate static HTML test report"
|
|
181
|
-
task :report => :environment do
|
|
182
|
-
CapyDash::ReportGenerator.generate_report
|
|
183
|
-
end
|
|
110
|
+
### Running Tests
|
|
184
111
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
end
|
|
189
|
-
end
|
|
112
|
+
```bash
|
|
113
|
+
# In a Rails app with RSpec
|
|
114
|
+
bundle exec rspec
|
|
190
115
|
```
|
|
191
116
|
|
|
192
|
-
###
|
|
117
|
+
### Building the Gem
|
|
193
118
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
```ruby
|
|
197
|
-
require "test_helper"
|
|
198
|
-
|
|
199
|
-
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|
200
|
-
driven_by :selenium, using: :headless_chrome, screen_size: [ 800, 600 ]
|
|
201
|
-
end
|
|
119
|
+
```bash
|
|
120
|
+
gem build capydash.gemspec
|
|
202
121
|
```
|
|
203
122
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
### Testing with Dummy App
|
|
207
|
-
|
|
208
|
-
The project includes a dummy Rails app for testing. To run it:
|
|
123
|
+
### Publishing
|
|
209
124
|
|
|
210
125
|
```bash
|
|
211
|
-
|
|
212
|
-
bundle install
|
|
213
|
-
bundle exec rails test
|
|
126
|
+
gem push capydash-0.2.0.gem
|
|
214
127
|
```
|
|
215
128
|
|
|
216
|
-
|
|
129
|
+
## License
|
|
217
130
|
|
|
218
|
-
|
|
219
|
-
2. Install dependencies: `bundle install`
|
|
220
|
-
3. Run the dummy app tests to verify everything works
|
|
221
|
-
4. Make your changes
|
|
222
|
-
5. Test with the dummy app
|
|
131
|
+
MIT
|
|
223
132
|
|
|
224
133
|
## Contributing
|
|
225
134
|
|
|
226
135
|
1. Fork the repository
|
|
227
136
|
2. Create a feature branch
|
|
228
137
|
3. Make your changes
|
|
229
|
-
4. Test with
|
|
138
|
+
4. Test with RSpec
|
|
230
139
|
5. Submit a pull request
|
|
231
140
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Build the gem:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
gem build capydash.gemspec
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
Push to RubyGems:
|
|
141
|
+
---
|
|
241
142
|
|
|
242
|
-
|
|
243
|
-
gem push capydash-0.1.0.gem
|
|
244
|
-
```
|
|
143
|
+
**Note:** CapyDash is a minimal MVP focused solely on RSpec system test reporting. It does not support Minitest, configuration DSLs, local servers, or screenshots. For a simple, zero-configuration test reporting solution, CapyDash is perfect.
|
data/capydash.gemspec
CHANGED
|
@@ -3,31 +3,25 @@ require_relative "lib/capydash/version"
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
5
5
|
spec.name = "capydash"
|
|
6
|
-
spec.version =
|
|
6
|
+
spec.version = CapyDash::VERSION
|
|
7
7
|
spec.authors = ["Damon Clark"]
|
|
8
8
|
spec.email = ["dclark312@gmail.com"]
|
|
9
9
|
|
|
10
|
-
spec.summary = "
|
|
11
|
-
spec.description = "CapyDash
|
|
10
|
+
spec.summary = "Minimal static HTML report generator for RSpec system tests"
|
|
11
|
+
spec.description = "CapyDash automatically generates clean, readable HTML test reports after your RSpec suite finishes. Zero configuration required."
|
|
12
12
|
spec.homepage = "https://github.com/damonclark/capydash"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
15
15
|
# Specify which files should be added to the gem when it is released.
|
|
16
|
-
spec.files = Dir["lib/**/*", "
|
|
16
|
+
spec.files = Dir["lib/**/*", "README.md", "LICENSE*", "*.gemspec"]
|
|
17
17
|
spec.require_paths = ["lib"]
|
|
18
18
|
|
|
19
|
-
# Add generator support
|
|
20
|
-
spec.add_runtime_dependency "railties", ">= 5.0"
|
|
21
|
-
|
|
22
19
|
# Dependencies
|
|
23
|
-
spec.add_runtime_dependency "
|
|
24
|
-
spec.add_runtime_dependency "faye-websocket"
|
|
25
|
-
spec.add_runtime_dependency "eventmachine"
|
|
26
|
-
spec.add_runtime_dependency "em-websocket"
|
|
20
|
+
spec.add_runtime_dependency "rspec", ">= 3.0"
|
|
27
21
|
|
|
28
22
|
# Development dependencies
|
|
29
|
-
spec.add_development_dependency "rspec", "~>
|
|
30
|
-
spec.add_development_dependency "rails", "
|
|
23
|
+
spec.add_development_dependency "rspec-rails", "~> 6.0"
|
|
24
|
+
spec.add_development_dependency "rails", ">= 6.0"
|
|
31
25
|
|
|
32
26
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
33
27
|
end
|