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
Expose cypress's --spec pattern option from yarn and therefore rake
I had a need to run the following locally:
CYPRESS=true SPEC=cypress/e2e/ui/Settings/Application-Settings/tenant.cy.js bundle exec rake spec:cypress
You could specify a directory to run all cypress tests within it:
CYPRESS=true SPEC=cypress/e2e/ui/Settings/Application-Settings bundle exec rake spec:cypress
Or a pattern:
CYPRESS=true SPEC=cypress/e2e/ui/**/settings* bundle exec rake spec:cypress
In case you wanted to test specific file name patterns, like below:
```
% tree
.
...
│
├── Settings
│ └── Application-Settings
│ ├── c_and_u_gap_collection.cy.js
│ ├── edit_collect_logs.cy.js
│ ├── schedule.cy.js
│ ├── settings_access_control.cy.js # <--- Want to test
│ ├── settings_details_tab.cy.js # <--- ^
│ ├── tenant.cy.js
│ └── zone.cy.js
├── settings.cy.js # <--- ^
├── validate-intercept-api-command.cy.js
└── validate-select-accordion-item.cy.js
```
This could have been done in the Rakefile but yarn should expose this so it can
be used for example, in CI, by setting environment variables. This solution
allows it's usage from both rake and yarn directly.
Note, rspec also has a SPEC env variable that is used in the same way to
specify a pattern for finding tests, see: https://github.com/rspec/rspec/blob/22549bbf4723ff893339d5233482894d33a24819/rspec-core/lib/rspec/core/rake_task.rb#L122
0 commit comments