Skip to content

Docs on using Cypress in a devcontainer #2956

Open
@johnnyreilly

Description

@johnnyreilly

Hello everyone!

I ❤️ Cypress - it is an amazing product. Thanks for your work on it.

I've found myself doing more and more work lately using devcontainers as my development environment in VS Code.

The one thing that I haven't yet cracked is working out how to get Cypress fully working in a devcontainer. I've been able to get a part of the way there by using the Node example devcontainer here: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/javascript-node-14

And tweaking it based upon the Cypress docs for CI here: https://docs.cypress.io/guides/guides/continuous-integration.html#Dependencies to add in the Cypress dependencies.

The tricky part is that whilst this gets us to the point of Cypress technically running, it doesn't show the Cypress Test Runner. Running cypress open . does not error which is lovely. However, crucially it doesn't fire up the Cypress Test Runner UI that you might expect. I imagine this is because the Test Runner uses an Electron app by default. I wonder if there's a way to do this by using the browser on the host machine (Chrome in my case) for the test runner.

I'm not sure what the way forward here would look like and I'm curious if there are docs that explain how to get up and running with devcontainers. I haven't found any and I suspect this is going to become an increasingly common workflow - it's likely that many others are likely trying to do the same thing. The advent of approaches such as GitHub Codespaces will only add to the popularity!

I'd be happy try and help out with some docs on this if I knew just how do get this up and running. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions