|
| 1 | +if defined?(CypressOnRails) |
| 2 | + CypressOnRails.configure do |c| |
| 3 | + c.api_prefix = "" |
| 4 | + c.install_folder = File.expand_path("#{__dir__}/../../e2e") |
| 5 | + |
| 6 | + c.server_readiness_path = "/users/new" |
| 7 | + # WARNING!! CypressOnRails can execute arbitrary ruby code |
| 8 | + # please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0 |
| 9 | + c.use_middleware = !Rails.env.production? |
| 10 | + # c.use_vcr_middleware = !Rails.env.production? |
| 11 | + # # Use this if you want to use use_cassette wrapper instead of manual insert/eject |
| 12 | + # # c.use_vcr_use_cassette_middleware = !Rails.env.production? |
| 13 | + # # Pass custom VCR options |
| 14 | + # c.vcr_options = { |
| 15 | + # hook_into: :webmock, |
| 16 | + # default_cassette_options: { record: :once }, |
| 17 | + # cassette_library_dir: File.expand_path("#{__dir__}/../../e2e/fixtures/vcr_cassettes") |
| 18 | + # } |
| 19 | + c.logger = Rails.logger |
| 20 | + |
| 21 | + # Server configuration for rake tasks (cypress:open, cypress:run, playwright:open, playwright:run) |
| 22 | + # c.server_host = 'localhost' # or use ENV['CYPRESS_RAILS_HOST'] |
| 23 | + # c.server_port = 3001 # or use ENV['CYPRESS_RAILS_PORT'] |
| 24 | + # c.transactional_server = true # Enable automatic transaction rollback between tests |
| 25 | + |
| 26 | + # Server lifecycle hooks for rake tasks |
| 27 | + # c.before_server_start = -> { DatabaseCleaner.clean_with(:truncation) } |
| 28 | + # c.after_server_start = -> { puts "Test server started on port #{CypressOnRails.configuration.server_port}" } |
| 29 | + # c.after_transaction_start = -> { Rails.application.load_seed } |
| 30 | + # c.after_state_reset = -> { Rails.cache.clear } |
| 31 | + # c.before_server_stop = -> { puts "Stopping test server..." } |
| 32 | + |
| 33 | + # If you want to enable a before_request logic, such as authentication, logging, sending metrics, etc. |
| 34 | + # Refer to https://www.rubydoc.info/gems/rack/Rack/Request for the `request` argument. |
| 35 | + # Return nil to continue through the Cypress command. Return a response [status, header, body] to halt. |
| 36 | + # c.before_request = lambda { |request| |
| 37 | + # unless request.env['warden'].authenticate(:secret_key) |
| 38 | + # return [403, {}, ["forbidden"]] |
| 39 | + # end |
| 40 | + # } |
| 41 | + end |
| 42 | + |
| 43 | + # # if you compile your asssets on CI |
| 44 | + # if ENV['CYPRESS'].present? && ENV['CI'].present? |
| 45 | + # Rails.application.configure do |
| 46 | + # config.assets.compile = false |
| 47 | + # config.assets.unknown_asset_fallback = false |
| 48 | + # end |
| 49 | + # end |
| 50 | +end |
0 commit comments