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
The cypress-rails gem provides a system of event hooks for loading and reloading test data. An example of these hooks is
CypressOnRails.hooks.before_server_start do
# Called once, before either the transaction or the server is started
end
We can add hooks similar to those provided by cypress-rails into the cypress-on-rails. They can be useful in certain situations, such as inserting data before the server starts/stops or reloading seeds after state reset using after_state_reset hook.
The text was updated successfully, but these errors were encountered:
Hooks like before_server_start ensures that the command is executed after the rails server is started. I had an issue where I needed to make sure there was some data in the database before the server started. It is relative to the rails server, not cypress. This will also require us to start the server from the gem instead of opening a new terminal.
cypress-rails provides a special route cypress_rails_reset_state for resetting the state/ rolling back the transaction to reset the application state before the test is run and after_state_reset hook which is triggered after it, which is different from what we have now with cy.app('clean') which cleans the whole database.
The
cypress-rails
gem provides a system of event hooks for loading and reloading test data. An example of these hooks isWe can add hooks similar to those provided by
cypress-rails
into thecypress-on-rails
. They can be useful in certain situations, such as inserting data before the server starts/stops or reloading seeds after state reset usingafter_state_reset
hook.The text was updated successfully, but these errors were encountered: