You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
### Changed
2
+
* Add support for proxy routes through `api_prefix`[PR 130](https://github.com/shakacode/cypress-on-rails/pull/130) by [RomainEndelin]
3
+
1
4
### Fixed
2
5
* Properly copies the cypress_helper file when running the update generator [PR 117](https://github.com/shakacode/cypress-on-rails/pull/117) by [alvincrespo]
* Allow build and build_list commands to be executed against factory bot [PR 87](https://github.com/shakacode/cypress-on-rails/pull/87) by [Alexander-Blair]
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
----
8
8
9
-
This project is sponsored by the software consulting firm [ShakaCode](https://www.shakacode.com), creator of the [React on Rails Gem](https://github.com/shakacode/react_on_rails). We focus on React (with TS or ReScript) front-ends, often with Ruby on Rails or Gatsby. See [our recent work](https://www.shakacode.com/recent-work) and [client engagement model](https://www.shakacode.com/blog/client-engagement-model/). Feel free to engage in discussions around this gem at our [Slack Channel](https://join.slack.com/t/reactrails/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE) or our [forum category for Cypress](https://forum.shakacode.com/c/cypress-on-rails/55).
9
+
This project is sponsored by the software consulting firm [ShakaCode](https://www.shakacode.com), creator of the [React on Rails Gem](https://github.com/shakacode/react_on_rails). We focus on React (with TS or ReScript) front-ends, often with Ruby on Rails or Gatsby. See [our recent work](https://www.shakacode.com/recent-work) and [client engagement model](https://www.shakacode.com/blog/client-engagement-model/). Feel free to engage in discussions around this gem at our [Slack Channel](https://join.slack.com/t/reactrails/shared_invite/enQtNjY3NTczMjczNzYxLTlmYjdiZmY3MTVlMzU2YWE0OWM0MzNiZDI0MzdkZGFiZTFkYTFkOGVjODBmOWEyYWQ3MzA2NGE1YWJjNmVlMGE) or our [forum category for Cypress](https://forum.shakacode.com/c/cypress-on-rails/55).
10
10
11
11
Interested in joining a small team that loves open source? Check our [careers page](https://www.shakacode.com/career/).
12
12
@@ -62,6 +62,9 @@ bin/rails g cypress_on_rails:install
62
62
# if you have/want a different cypress folder (default is cypress)
63
63
bin/rails g cypress_on_rails:install --cypress_folder=spec/cypress
64
64
65
+
# if you target the Rails server with a path prefix to your URL
66
+
bin/rails g cypress_on_rails:install --api_prefix=/api
67
+
65
68
# if you want to install cypress with npm
66
69
bin/rails g cypress_on_rails:install --install_cypress_with=npm
67
70
@@ -88,7 +91,7 @@ Now you can create scenarios and commands that are plain Ruby files that get loa
88
91
### Update your database.yml
89
92
90
93
When running `cypress test` on your local computer it's recommended to start your server in development mode so that changes you
91
-
make are picked up without having to restart the server.
94
+
make are picked up without having to restart the server.
92
95
It's recommended you update your `database.yml` to check if the `CYPRESS` environment variable is set and switch it to the test database
93
96
otherwise cypress will keep clearing your development database.
94
97
@@ -115,9 +118,9 @@ Getting started on your local environment
115
118
CYPRESS=1 bin/rails server -p 5017
116
119
117
120
# in separate window start cypress
118
-
yarn cypress open
121
+
yarn cypress open
119
122
# or for npm
120
-
node_modules/.bin/cypress open
123
+
node_modules/.bin/cypress open
121
124
# or if you changed the cypress folder to spec/cypress
122
125
yarn cypress open --project ./spec
123
126
```
@@ -130,7 +133,7 @@ How to run cypress on CI
130
133
131
134
yarn run cypress run
132
135
# or for npm
133
-
node_modules/.bin/cypress run
136
+
node_modules/.bin/cypress run
134
137
```
135
138
136
139
### Example of using factory bot
@@ -399,6 +402,17 @@ beforeEach(() => {
399
402
});
400
403
```
401
404
405
+
## API Prefix
406
+
407
+
If your Rails server is exposed under a proxy, typically https://my-local.dev/api, you can use the `api_prefix` option.
408
+
In `config/initializers/cypress_on_rails.rb`, add this line:
409
+
```ruby
410
+
CypressOnRails.configure do |c|
411
+
# ...
412
+
c.api_prefix ='/api'
413
+
end
414
+
```
415
+
402
416
## Contributing
403
417
404
418
1. Fork it ( https://github.com/shakacode/cypress-on-rails/fork )
0 commit comments