-
Notifications
You must be signed in to change notification settings - Fork 913
Add cypress-on-rails support #23600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add cypress-on-rails support #23600
+5
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 task
Fryguy
reviewed
Sep 29, 2025
1a8303b to
1ac51f8
Compare
1ac51f8 to
9133d61
Compare
jrafanie
commented
Oct 1, 2025
8f26a2c to
47b6610
Compare
Member
Author
|
@miq-bot cross_repo_test including ManageIQ/manageiq-ui-classic#9633 |
miq-bot
pushed a commit
to ManageIQ/manageiq-cross_repo-tests
that referenced
this pull request
Oct 1, 2025
From Pull Request: ManageIQ/manageiq#23600
e2fb507 to
d9fd080
Compare
d9fd080 to
b53de11
Compare
Enables: ManageIQ/manageiq-ui-classic#9633 We add this to core so the railtie in cypress-on-rails can hook into the rails app startup as needed: https://github.com/shakacode/cypress-playwright-on-rails/blob/d50de890b345879205124fa4de52bf899d9df2d0/lib/cypress_on_rails/railtie.rb#L6 Note, this could be pushed down to UI Classic, see below, but this has a few problems: 1) Core already has bundler groups for development and test that these nicely fit into. This allows us to easily exclude them from different installation scenarios such as smaller deployments with just the required runtime dependencies. 2) UI-Classic is a gem engine that gets pulled in, so only the runtime dependencies are resolved and available. Therefore, we would need to add these test gems as runtime dependencies which sends the wrong message and makes it difficult to exclude. Alternative setup (not suggested): a) Remove it from core: ```diff --git a/Gemfile b/Gemfile index cd45015..b62ae61 100644 --- a/Gemfile +++ b/Gemfile @@ -326,7 +326,4 @@ group :development, :test do gem "parallel_tests", "~>4.4", :require => false gem "routes_lazy_routes" gem "rspec-rails", "~>7.0" - gem "cypress-on-rails", "~>1.19.0" # Need railtie to be loaded with rails app - gem "factory_bot_rails" - gem "database_cleaner", "~>2.1" end ``` b) Require it in UI-Classic's Engine and add the gems to the gemspec: ```diff --git a/lib/manageiq/ui/classic/engine.rb b/lib/manageiq/ui/classic/engine.rb index dc72a001ec..cf420620c1 100644 --- a/lib/manageiq/ui/classic/engine.rb +++ b/lib/manageiq/ui/classic/engine.rb @@ -36,6 +36,8 @@ module ManageIQ config.assets.js_compressor = :manageiq_ui_classic_js_compressor end + require 'cypress-on-rails' if ENV['CYPRESS'].present? + def self.vmdb_plugin? true end diff --git a/manageiq-ui-classic.gemspec b/manageiq-ui-classic.gemspec index cef587a45a..3ed378abed 100644 --- a/manageiq-ui-classic.gemspec +++ b/manageiq-ui-classic.gemspec @@ -31,7 +31,10 @@ Gem::Specification.new do |s| s.add_dependency "uglifier", "~>4.2.0" s.add_dependency "webpacker", "~>2.0.0" - s.add_development_dependency "cypress-on-rails", "~> 1.0" + s.add_dependency "cypress-on-rails", "~>1.17.0" + s.add_dependency "factory_bot_rails" + s.add_dependency "database_cleaner", "~>2.1" + ```
b53de11 to
828dc29
Compare
These are UI dependencies that will be required in the UI Classic engine.rb
Member
Author
|
@Fryguy This one is ready to go. I'd like to kick ManageIQ/manageiq-ui-classic#9633 so the cypress tests can run on CI there with this merged. I ran them locally but want to make sure I'm not breaking anything. |
Fryguy
approved these changes
Oct 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables: ManageIQ/manageiq-ui-classic#9633 to use cypress on rails
We add this to core so the railtie in cypress-on-rails can hook into the rails
app startup as needed:
https://github.com/shakacode/cypress-playwright-on-rails/blob/d50de890b345879205124fa4de52bf899d9df2d0/lib/cypress_on_rails/railtie.rb#L6
Note, this could be pushed down to UI Classic, see below, but this has a few
problems:
Core already has bundler groups for development and test that these nicely
fit into. This allows us to easily exclude them from different installation
scenarios such as smaller deployments with just the required runtime
dependencies.
UI-Classic is a gem engine that gets pulled in, so only the runtime
dependencies are resolved and available. Therefore, we would need to add these
test gems as runtime dependencies which sends the wrong message and makes it
difficult to exclude.
Alternative setup (not suggested):
a) Remove it from core:
b) Require it in UI-Classic's Engine and add the gems to the gemspec: