Skip to content

Commit 1c12644

Browse files
committed
Configure cypress on rails for our needs
* Use Engine path for cypress directory * Guard using CYPRESS ENV * Remove not needed changes to cypress.config.js
1 parent 032e20d commit 1c12644

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

config/initializers/cypress_on_rails.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
if defined?(CypressOnRails)
1+
# This is identical to the generated file[1] with the exceptions below:
2+
# [1] https://github.com/shakacode/cypress-playwright-on-rails/blob/ac5d69f9ea951c7545e5141db2abb2cb1350e740/lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb
3+
# * install_folder (uses our rails engine path)
4+
# * require ENV['CYPRESS'] to be set
5+
if defined?(CypressOnRails) && ENV['CYPRESS'].present?
26
CypressOnRails.configure do |c|
37
c.api_prefix = ""
4-
c.install_folder = File.expand_path("#{__dir__}/../../e2e/cypress")
8+
9+
# Currently, the only change from the template:
10+
c.install_folder = ManageIQ::UI::Classic::Engine.root.join("cypress/e2e")
511
# WARNING!! CypressOnRails can execute arbitrary ruby code
612
# please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0
713
c.use_middleware = !Rails.env.production?

cypress.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ const fs = require('fs');
44

55
module.exports = defineConfig({
66
e2e: {
7-
// baseUrl: "http://localhost:5017",
8-
// defaultCommandTimeout: 10000,
97
baseUrl: 'http://localhost:3000',
108
viewportHeight: 800,
119
viewportWidth: 1800,

0 commit comments

Comments
 (0)