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.

Be able to run cypress/included on an Nx workspace

See original GitHub issue

What would you like?

I would like to maintain the less possible code in order to execute my Cypress tests on an Nx workspace 😁.

As I explained here, for the moment I maintain my own Docker image, with Cypress included for running the Cypress tests of my Nx workspace (this image is shared across developers and CI machines and the command used to run tests is the Nx one).

Few days ago, I discovered this article, presenting cypress/included and I would be very happy to use it as a single Cypress source of truth. Unfortunately I am not able to run it on an Nx workspace (I tested it on a classical Angular app and liked it a lot 😋).

Why is this ~needed~ wanted?

Nx workspaces are very powerful and popular, providing a “ready-to-go” image to its users could improve their dev(ops) experience (in fact, I know several companies which would be very interested in this strategy for running their Cypress tests).

Note

Following the discussion in the abovementioned issue, I am considering the fact this feature could be transformed in a “documentation feature” because I suppose the issue can be solved by mounting the correct files in their correct places. Does anyone have an idea of something which could match in this case?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
weyertcommented, Feb 12, 2021

Personally, I would advise to make a reproducible repository. I would happy to have a look but don’t have the time to recreate your setup

0reactions
hadrien-tomacommented, Feb 13, 2021

I am now able to use the cypress/included image only as I wanted. What I have done:

  • Use --entrypoint docker run argument in order to set it to /bin/bash and bypass the default cypress command execution
  • Mount the Nx workspace in the container
  • Set the Docker container “working directory” to the Nx workspace
  • Execute the standard npm run nx e2e command inside the container

Simple, efficient, with nearly 0 technical debt, thank you very much Cypress team to provide this included image! 😍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Share Cypress Commands in an Nx Workspace
Running Cypress in an Nx workspace​​ happynrwl-e2e is the Cypress application that got generated for our happynrwl React app. You can also pass...
Read more >
@nrwl/cypress | Nx
Cypress is a test runner built for the modern web. It has a lot of great features: Time travel; Real-time reloads; Automatic waiting;...
Read more >
Share Cypress Commands in an Nx Workspace - YouTube
Nx has had strong Cypress support from the very beginning, by providing generators to automatically set Cypress up for new projects and even ......
Read more >
Use Cypress with Next.js and Nx to battle test your React ...
Launch Storybook Cypress e2e tests​​ By passing the --watch flag, we can interact with the Cypress runner which is handy during development. ...
Read more >
How to run cypress tests with tags in nrwl nx workspace
I had the same issue and got a workaround by using the ENV object from the NX configuration: This way, I added the...
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