question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration to Cypress 10 causes tests to fail after the fact

See original GitHub issue

Current Behavior

Using my existing project, with Cypress 9.7.0 has the test files called app.spec.ts. Running the nx g @nrwl/cypress:migrate-to-cypress-10 completes successfully. Attempting to run the tests however, errors out with:

Can't run because no spec files were found.
We searched for specs matching this glob pattern:
> ui-e2e\src\e2e\**\*.cy.{js,jsx,ts,tsx}

The issue is the test files are still called *.spec.ts, while the new Cypress configuration is looking for *.cy.ts. The pathing has also changed to require the test files in an e2e subdirectory (src/e2e/ instead of src/).

Expected Behavior

The configuration should support the *.spec.ts file specifications, or renaming the test files in the project accordingly including the new path change.

Steps to Reproduce

Take a project with the Cypress 9.7.x, and then run the nx g @nrwl/cypress:migrate-to-cypress-10. When this is done, try to run the e2e test nx e2e ui-e2e and the error will occur.

Failure Logs

Environment

Node : 18.5.0 OS : win32 x64 npm : 8.12.1

nx : 14.5.10 @nrwl/angular : 14.5.10 @nrwl/cypress : 14.5.10 @nrwl/detox : Not Found @nrwl/devkit : 14.5.10 @nrwl/eslint-plugin-nx : 14.5.10 @nrwl/express : Not Found @nrwl/jest : 14.5.10 @nrwl/js : 14.5.10 @nrwl/linter : 14.5.10 @nrwl/nest : 14.5.10 @nrwl/next : Not Found @nrwl/node : 14.5.10 @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.5.10 @nrwl/web : 14.5.10 @nrwl/workspace : 14.5.10 typescript : 4.7.4

Local workspace plugins:

Community plugins: @jscutlery/semver: 2.26.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
barbados-clemenscommented, Sep 15, 2022

thanks for the pointing out the trouble areas @robinpellegrims have a PR to address this issue.

1reaction
Chowarmaancommented, Sep 1, 2022

I have emptied out the application, and have a basic environment available to show the issue on GitHub

Using the nx e2e timesheet-ui-e2e will run the tests and pass. Run the nx generate @nrwl/cypress:migrate-to-cypress-10 and the process finishes. Run the e2e test again, and you will see the failure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration Guide | Cypress Documentation
However, in Cypress 12, this test fails because the alias is always re-queried from the DOM, effectively resulting in the following execution:.
Read more >
test runner randomly fails when running electron locally · Issue ...
Current behavior So when running COMPONENT tests specs locally, the test runner randomly crashes out at varying specs.
Read more >
Migrating Test Automation Suite To Cypress 10 - LambdaTest
This detailed blog on Cypress 10 migration will explain how to migrate your test automation suite to Cypress 10 and execute it over...
Read more >
Migrating to Cypress 10 - YouTube
In this video, we discuss how to migrate your existing Cypress projects to v10.Have questions? Join the official Cypress Discord: ...
Read more >
Puppeteer, Selenium, Playwright, Cypress - how to choose?
We evaluated test automation frameworks including: Puppeteer, Selenium, Playwright, and Cypress. Adjust the weights to fit your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found