All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- Rake tasks for test execution: Added
cypress:openandcypress:runrake tasks for seamless test execution, similar to cypress-rails functionality. Also addedplaywright:openandplaywright:runtasks. - Server lifecycle hooks: Added configuration hooks for test server management:
before_server_start: Run code before Rails server startsafter_server_start: Run code after Rails server is readyafter_transaction_start: Run code after database transaction beginsafter_state_reset: Run code after application state is resetbefore_server_stop: Run code before Rails server stops
- State reset endpoint: Added
/cypress_rails_reset_stateand/__cypress__/reset_stateendpoints for compatibility with cypress-rails - Transactional test mode: Added support for automatic database transaction rollback between tests
- Environment configuration: Support for
CYPRESS_RAILS_HOSTandCYPRESS_RAILS_PORTenvironment variables - Automatic server management: Test server automatically starts and stops with test execution
If you were previously running tests manually:
Before (Manual Process):
# Terminal 1: Start Rails server
CYPRESS=1 bin/rails server -p 5017
# Terminal 2: Run tests
yarn cypress open --project ./e2e
# or
npx cypress run --project ./e2eAfter (Automated with Rake Tasks):
# Single command - server managed automatically!
bin/rails cypress:open
# or
bin/rails cypress:runIf migrating from the cypress-rails gem:
-
Update your Gemfile:
# Remove gem 'cypress-rails' # Add gem 'cypress-on-rails', '~> 1.0'
-
Run bundle and generator:
bundle install rails g cypress_on_rails:install
-
Configure hooks in
config/initializers/cypress_on_rails.rb(optional):CypressOnRails.configure do |c| # These hooks match cypress-rails functionality c.before_server_start = -> { DatabaseCleaner.clean } c.after_server_start = -> { Rails.application.load_seed } c.transactional_server = true end
-
Use the same commands you're familiar with:
bin/rails cypress:open bin/rails cypress:run
1.18.0 — 2025-08-27
- VCR middleware (use_cassette): optional middleware that wraps each request with
VCR.use_cassette(GraphQL supported). Includes configuration viaconfig/cypress_on_rails.rband Cypress commands. PR 167 - Rails 8 example app & CI job to validate against the newest framework version. PR 174
- Dropped Rails 4 and 5 from CI matrix. PR 172
1.17.0 — 2024-01-28
- Removed the update generator and reduced options for install generator PR 149
- Fix update
index.jsin install generator PR 147 by [Judahmeek] - Support Rails 7.1 by adding
content-typeheader to generatedon-rails.jsfile PR 148 by [anark] - Rewind body before reading it PR 150
- Add support for
before_requestoptions on the middleware, for authentication PR 138 by [RomainEndelin]
- Fix
cypress_folderdeprecation warning by internal code PR 136
- Add support for any e2e testing framework starting with Playwright PR 131 by [KhaledEmaraDev]
- Add support for proxy routes through
api_prefixPR 130 by [RomainEndelin]
- Properly copies the cypress_helper file when running the update generator PR 117 by [alvincrespo]
- Pass Cypress record key to GitHub Action PR 110
use_vcr_middlewaredisabled by default PR 109
- Add support for matching npm package and VCR
- Generate for Cypress 10 PR 108
- Document how to setup Factory Associations PR 100
- Keep track of factory manual reloads to prevent auto_reload from reloading again PR 98
- Only reload factories on clean instead of every factory create request PR 95
- Alternative command added for get tail of logs PR 89 by [ccrockett]
- Switch from Travis to GitHub Actions PR 96
- Improve app command logging on Cypress
- Allow build and build_list commands to be executed against FactoryBot PR 87 by [Alexander-Blair]
- Improve error message received from failed command
- Fix using
loadin command files
- Update default generated folder to
cypressinstead ofspec/cypress - Add a generator option to not install Cypress
- Generator by default does not include examples
- Default on local to run Cypress in development mode
- Remove
--silentoption when adding Cypress PR 76 - Update Cypress examples to use "preserve" instead of "whitelist" PR 75 by [alvincrespo]
- Use
FactoryBot#reloadto reset FactoryBot
- Improve eval() in command executor PR 46 by [Systho]
- Add middleware after load_config_initializers PR 62 by [duytd]
- Change default port to 5017 PR 49 by [vfonic]
- Fix file location warning message in clean.rb PR 54 by [ootoovak]
- Fix FactoryBot Trait not registered error PR 43
- Serialize and return responses to be used in tests PR 34
- Update generator to make it easier to update core generated files PR 35
- Update integration tests PR 36
- Update generator to use full paths for Factory files PR 33
- Fix install generator when using npm PR 22 by [josephan]
- Fix typo in authentication docs PR 29 by [badimalex]
- Gemspec: Drop EOL'd property
rubyforge_projectPR 27 by [olleolleolle] - Update Travis CI badge in README PR 31
- Fix CI by installing Cypress dependencies on Travis CI PR 31
- Accept an options argument for scenarios PR 18 by [ericraio]
- Renamed CypressDev to CypressOnRails
- Send any arguments to simple Rails factory, not only hashes by [grantspeelman]
- Stop running Cypress examples on CI
- Simple factory fails silently, changed to use
create!
- Add additional log failure logging
- Smart factory wrapper can handle when factory files get deleted
- Add Cypress examples to install generator
- Add ActiveRecord integration specs
- Install generator adding
on-rails.jstoimport.js
- Renamed to CypressDev
- Middleware stripped down to make it more flexible and generic
- Concept of generic commands introduced that can have any Ruby in it
- And lots of other changes
- Fix major bug when using scenarios
- Fix failure in API tests
- Remove the need for a separate port for the setup calls. Requires rerunning
cypress:installgenerator
cy.railscommand for executing raw Ruby on the backendcy.setupRailscommand for resetting application statecypress:installgenerator now adds abeforeEachcall tocy.setupRailscypress:installgenerator configures thecache_classessetting inconfig/environments/test.rb- Configuration option to include further modules in your runcontext
- First release.