Skip to content
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

feat: Enable requiring cy.origin dependencies with require() and import() #24294

Merged
merged 4 commits into from
Oct 18, 2022

Conversation

chrisbreiding
Copy link
Contributor

@chrisbreiding chrisbreiding commented Oct 18, 2022

User facing changelog

  • Enabled using dependencies within the cy.origin() callback using require() and dynamic import(). Removed Cypress.require().

Additional details

Steps to test

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 18, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Oct 18, 2022



Test summary

45918 0 4490 0Flakiness 5


Run details

Project cypress
Status Passed
Commit 3aecb02
Started Oct 18, 2022 8:20 PM
Ended Oct 18, 2022 8:37 PM
Duration 16:55 💡
OS Linux Debian - 11.4
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

migration.cy.ts Flakiness
1 Full migration flow for each project > migration-e2e-component-default-test-files > skips the file renaming
commands/assertions.cy.js Flakiness
1 ... > has a pending state while retrying for commands with onFail
2 ... > has a pending state while retrying for commands with onFail
commands/xhr.cy.js Flakiness
1 src/cy/commands/xhr > abort > aborts xhrs currently in flight
specs_list_latest_runs.cy.ts Flakiness
1 App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@chrisbreiding chrisbreiding marked this pull request as ready for review October 18, 2022 20:13
@mjhenkes mjhenkes self-requested a review October 18, 2022 20:21
@mschile mschile self-requested a review October 18, 2022 20:24
Variables must either be defined within the ${cmd('origin')} command or passed in using the args option.`,
Variables must either be defined within the ${cmd('origin')} command or passed in using the args option.

Using \`require()\` or \`import()\` to include dependencies requires using the latest version of \`@cypress/webpack-preprocessor\`.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest specifying the required version of the webpack preprocessor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trouble is, I won't know what version that is until this is merged and it's actually released.

Also, when this was originally released, I could have guessed the version was going to be 5.13.0 and hard-coded that into the error message, but webpack-preprocessor@5.13.0 ended being broken. That required a 5.13.1 release, meaning the error message would have been misleading. I think recommending the latest version is the safest bet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove need for Cypress.require and support dynamic import
3 participants