Skip to content

Commit 603319d

Browse files
committed
Merge branch 'main' into configuration-via-ruby-and-env-file
2 parents 54d1c9a + a05758c commit 603319d

File tree

96 files changed

+2680
-2816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2680
-2816
lines changed

.circleci/config.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
ruby-version: ['2.7', '3.0']
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: ${{ matrix.ruby-version }}
18+
bundler-cache: true
19+
20+
- name: Run tests
21+
run: ./script/test

.standard.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
ruby_version: 2.5
12
ignore:
23
- 'vendor/bundle/**/*'
3-
- 'example/an_app/node_modules/**/*'
4-
- 'example/an_app/vendor/bundle/**/*'
4+
- 'example/node_modules/**/*'
5+
- 'example/vendor/bundle/**/*'

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# CHANGELOG
22

3+
## 0.5.5
4+
5+
* Add Puma 6 support
6+
[#136](https://github.com/testdouble/cypress-rails/pull/136)
7+
8+
## 0.5.4
9+
10+
* Fix Rails 5 support
11+
[#126](https://github.com/testdouble/cypress-rails/pull/126)
12+
13+
## 0.5.3
14+
15+
* Fix 2.5 & 2.6 compatibility
16+
[#100](https://github.com/testdouble/cypress-rails/issues/100)
17+
18+
## 0.5.2
19+
20+
* Fixes a puma deprecation warning
21+
[#95](https://github.com/testdouble/cypress-rails/pull/95)
22+
23+
## 0.5.1
24+
25+
* Sprinkles two instance variables to the custom transaction manager that cribs
26+
its implementation from ActiveRecord::TestFixtures (see f75f280)
27+
[#88](https://github.com/testdouble/cypress-rails/issues/88)
28+
[#89](https://github.com/testdouble/cypress-rails/pull/89)
29+
30+
## 0.5.0
31+
32+
* Add hook `after_server_start`
33+
[#63](https://github.com/testdouble/cypress-rails/pull/63)
34+
* Fix namespace bug
35+
[#64](https://github.com/testdouble/cypress-rails/pull/64)
36+
337
## 0.4.2
438

539
* Add support to Rails 6.1 ([#52](https://github.com/testdouble/cypress-rails/issue/52))

Gemfile.lock

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,96 @@
11
PATH
22
remote: .
33
specs:
4-
cypress-rails (0.4.2)
4+
cypress-rails (0.5.5)
55
puma (>= 3.8.0)
66
railties (>= 5.2.0)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
actionpack (6.1.0)
12-
actionview (= 6.1.0)
13-
activesupport (= 6.1.0)
14-
rack (~> 2.0, >= 2.0.9)
11+
actionpack (7.0.4)
12+
actionview (= 7.0.4)
13+
activesupport (= 7.0.4)
14+
rack (~> 2.0, >= 2.2.0)
1515
rack-test (>= 0.6.3)
1616
rails-dom-testing (~> 2.0)
1717
rails-html-sanitizer (~> 1.0, >= 1.2.0)
18-
actionview (6.1.0)
19-
activesupport (= 6.1.0)
18+
actionview (7.0.4)
19+
activesupport (= 7.0.4)
2020
builder (~> 3.1)
2121
erubi (~> 1.4)
2222
rails-dom-testing (~> 2.0)
2323
rails-html-sanitizer (~> 1.1, >= 1.2.0)
24-
activesupport (6.1.0)
24+
activesupport (7.0.4)
2525
concurrent-ruby (~> 1.0, >= 1.0.2)
2626
i18n (>= 1.6, < 2)
2727
minitest (>= 5.1)
2828
tzinfo (~> 2.0)
29-
zeitwerk (~> 2.3)
30-
ast (2.4.1)
29+
ast (2.4.2)
3130
builder (3.2.4)
32-
concurrent-ruby (1.1.7)
31+
concurrent-ruby (1.1.10)
3332
crass (1.0.6)
34-
erubi (1.10.0)
35-
i18n (1.8.5)
33+
erubi (1.11.0)
34+
i18n (1.12.0)
3635
concurrent-ruby (~> 1.0)
37-
loofah (2.8.0)
36+
loofah (2.19.0)
3837
crass (~> 1.0.2)
3938
nokogiri (>= 1.5.9)
4039
method_source (1.0.0)
41-
mini_portile2 (2.4.0)
42-
minitest (5.14.2)
43-
nio4r (2.5.4)
44-
nokogiri (1.10.10)
45-
mini_portile2 (~> 2.4.0)
46-
parallel (1.20.1)
47-
parser (2.7.2.0)
40+
mini_portile2 (2.8.0)
41+
minitest (5.15.0)
42+
nio4r (2.5.8)
43+
nokogiri (1.13.8)
44+
mini_portile2 (~> 2.8.0)
45+
racc (~> 1.4)
46+
parallel (1.22.1)
47+
parser (3.1.2.0)
4848
ast (~> 2.4.1)
49-
puma (5.1.1)
49+
puma (6.0.0)
5050
nio4r (~> 2.0)
51-
rack (2.2.3)
52-
rack-test (1.1.0)
53-
rack (>= 1.0, < 3)
51+
racc (1.6.0)
52+
rack (2.2.4)
53+
rack-test (2.0.2)
54+
rack (>= 1.3)
5455
rails-dom-testing (2.0.3)
5556
activesupport (>= 4.2.0)
5657
nokogiri (>= 1.6)
57-
rails-html-sanitizer (1.3.0)
58+
rails-html-sanitizer (1.4.3)
5859
loofah (~> 2.3)
59-
railties (6.1.0)
60-
actionpack (= 6.1.0)
61-
activesupport (= 6.1.0)
60+
railties (7.0.4)
61+
actionpack (= 7.0.4)
62+
activesupport (= 7.0.4)
6263
method_source
63-
rake (>= 0.8.7)
64+
rake (>= 12.2)
6465
thor (~> 1.0)
65-
rainbow (3.0.0)
66-
rake (13.0.1)
67-
regexp_parser (2.0.0)
68-
rexml (3.2.4)
69-
rubocop (1.4.2)
66+
zeitwerk (~> 2.5)
67+
rainbow (3.1.1)
68+
rake (13.0.6)
69+
regexp_parser (2.4.0)
70+
rexml (3.2.5)
71+
rubocop (1.29.1)
7072
parallel (~> 1.10)
71-
parser (>= 2.7.1.5)
73+
parser (>= 3.1.0.0)
7274
rainbow (>= 2.2.2, < 4.0)
73-
regexp_parser (>= 1.8)
74-
rexml
75-
rubocop-ast (>= 1.1.1)
75+
regexp_parser (>= 1.8, < 3.0)
76+
rexml (>= 3.2.5, < 4.0)
77+
rubocop-ast (>= 1.17.0, < 2.0)
7678
ruby-progressbar (~> 1.7)
77-
unicode-display_width (>= 1.4.0, < 2.0)
78-
rubocop-ast (1.3.0)
79-
parser (>= 2.7.1.5)
80-
rubocop-performance (1.9.1)
81-
rubocop (>= 0.90.0, < 2.0)
79+
unicode-display_width (>= 1.4.0, < 3.0)
80+
rubocop-ast (1.18.0)
81+
parser (>= 3.1.1.0)
82+
rubocop-performance (1.13.3)
83+
rubocop (>= 1.7.0, < 2.0)
8284
rubocop-ast (>= 0.4.0)
83-
ruby-progressbar (1.10.1)
84-
standard (0.10.2)
85-
rubocop (= 1.4.2)
86-
rubocop-performance (= 1.9.1)
87-
thor (1.0.1)
88-
tzinfo (2.0.4)
85+
ruby-progressbar (1.11.0)
86+
standard (1.12.1)
87+
rubocop (= 1.29.1)
88+
rubocop-performance (= 1.13.3)
89+
thor (1.2.1)
90+
tzinfo (2.0.5)
8991
concurrent-ruby (~> 1.0)
90-
unicode-display_width (1.7.0)
91-
zeitwerk (2.4.2)
92+
unicode-display_width (2.1.0)
93+
zeitwerk (2.6.1)
9294

9395
PLATFORMS
9496
ruby
@@ -101,4 +103,4 @@ DEPENDENCIES
101103
standard (>= 0.2.0)
102104

103105
BUNDLED WITH
104-
2.1.4
106+
2.3.13

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cypress-rails
22

3-
[![CircleCI](https://circleci.com/gh/testdouble/cypress-rails/tree/master.svg?style=svg)](https://circleci.com/gh/testdouble/cypress-rails/tree/master)
4-
53
This is a simple gem to make it easier to start writing browser tests with
64
[Cypress](http://cypress.io) for your [Rails](https://rubyonrails.org) apps,
75
regardless of whether your app is server-side rendered HTML, completely
@@ -120,7 +118,7 @@ end
120118

121119
(You can find [an
122120
example
123-
initializer](/example/an_app/config/initializers/cypress_rails_initializer.rb)
121+
initializer](/example/config/initializers/cypress_rails_initializer.rb)
124122
in this repo.)
125123

126124
The gem also provides a special route on the test server:
@@ -170,7 +168,7 @@ preferred environment variables project-wide using a tool like
170168
general this means anything done during `cypress open` or `cypress run` will
171169
be rolled back on exit (similar to running a Rails System test)
172170
* **CYPRESS_RAILS_CYPRESS_OPTS** (default: _none_) any options you want to
173-
forward to the Cypress CLI when running its `open` or `run` commands
171+
forward to the Cypress CLI when running its `open` or `run` commands.
174172

175173
#### Example: Running a single spec from the command line
176174

@@ -181,6 +179,14 @@ Cypress test would look like this:
181179
$ CYPRESS_RAILS_CYPRESS_OPTS="--spec cypress/integration/a_test.js" bin/rake cypress:run
182180
```
183181

182+
#### Example: Running your tests in Chromium
183+
184+
By default, Cypress will run its tests in its packaged Electron app, unless you've configured it globally. To choose which browser it will run from the command line, try this:
185+
186+
```
187+
$ CYPRESS_RAILS_CYPRESS_OPTS="--browser chromium" bin/rake cypress:run
188+
```
189+
184190
### Initializer hooks
185191

186192
### before_server_start
@@ -190,6 +196,11 @@ will execute before the server or any transaction has been started. If you use
190196
Rails fixtures, it may make sense to load them here, so they don't need to be
191197
re-inserted for each request
192198

199+
### after_server_start
200+
201+
Pass a block to `CypressRails.hooks.after_server_start` to register a hook that
202+
will execute after the server has booted.
203+
193204
### after_transaction_start
194205

195206
If there's any custom behavior or state management you want to do inside the
@@ -215,7 +226,7 @@ of your test database. To set up the hook, pass a block to
215226
## Configuring Rails
216227

217228
Beyond the configuration options above, you'll probably also want to disable caching
218-
in your Rails app's [config/environments/test.rb](/example/an_app/config/environments/test.rb#L9)
229+
in your Rails app's [config/environments/test.rb](/example/config/environments/test.rb#L9)
219230
file, so that changes to your Ruby code are reflected in your tests while you
220231
work on them with `rake cypress:open`. (If either option is set to
221232
`true`, any changes to your Ruby code will require a server restart to be reflected as you work
@@ -304,7 +315,7 @@ experience. In particular:
304315
and more information dense than using Capybara and Selenium. Rather than
305316
running a test from the command line, seeing it fail, then adding a debug
306317
breakpoint to a test to try to manipulate the browser or tweaking a call to a
307-
Capybara API method, failures to be rather obvious when using Cypress and
318+
Capybara API method, failures tend to be rather obvious when using Cypress and
308319
fixing it is usually as easy as tweaking a command, hitting save, and watching
309320
it re-run
310321
* With very few exceptions, a Cypress test that works in a browser window will
File renamed without changes.
File renamed without changes.

example/Gemfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
source "https://rubygems.org"
2+
3+
gem "rails"
4+
gem "sqlite3"
5+
gem "puma"
6+
gem "webpacker"
7+
gem "bootsnap", require: false
8+
9+
group :development, :test do
10+
gem "cypress-rails", path: ".."
11+
end

0 commit comments

Comments
 (0)