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

Re-add option for running Cypress in a container #681

Closed
1 task
afeld opened this issue Jun 14, 2022 · 7 comments
Closed
1 task

Re-add option for running Cypress in a container #681

afeld opened this issue Jun 14, 2022 · 7 comments
Labels
chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. tests Related to automated testing (unit, UI, integration, etc.)

Comments

@afeld
Copy link
Contributor

afeld commented Jun 14, 2022

See discussion in #671.

Acceptance Criteria

  • With Docker installed, the Cypress tests can be run from the command line in (close to?) a single command

Additional context

@afeld afeld added chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. tests Related to automated testing (unit, UI, integration, etc.) labels Jun 14, 2022
@angela-tran
Copy link
Member

The closest I've gotten on this is to run the following (note that %cd% is for Windows, $pwd can be used for Mac/Linux?):
docker run -it -v %cd%:/tests/cypress -v %cd%/../../fixtures:/fixtures -w /tests/cypress cypress/included:10.3.0

It took me a few tries to get the volume mapping correct since we're using fixtures that are a few levels above our Cypress tests. The next thing to figure out is how to get the app running -- with the command I just mentioned, the tests are failing because of 404s.

I was referencing this article: https://www.cypress.io/blog/2019/05/02/run-cypress-with-a-single-docker-command/

@angela-tran
Copy link
Member

angela-tran commented Jul 5, 2022

I created a Docker Compose configuration that's more or less equivalent to the command above. With the app running locally, you can run the Cypress tests and see some passing. I created a WIP branch here: https://github.com/cal-itp/benefits/compare/chore/cypress-container

You can try it out by checking out the branch and then, outside the devcontainer, running:

cd tests/cypress
docker compose up --exit-code-from cypress

@angela-tran angela-tran moved this to In Progress in Digital Services Jul 6, 2022
@angela-tran angela-tran self-assigned this Jul 6, 2022
@vykster vykster moved this from In Progress to Backlog in Digital Services Jul 11, 2022
@machikoyasuda machikoyasuda added the ON HOLD Work is paused while awaiting feedback from Product label Jul 11, 2022
@thekaveman thekaveman removed the ON HOLD Work is paused while awaiting feedback from Product label Feb 17, 2023
@thekaveman
Copy link
Member

Removing the ON HOLD label as we'll want to get this working again once #1263 and #1277 are in.

@afeld afeld assigned afeld and unassigned angela-tran Feb 27, 2023
@afeld afeld moved this from Backlog to This Sprint (Month) in Digital Services Feb 27, 2023
@afeld
Copy link
Contributor Author

afeld commented Feb 28, 2023

I forgot I looked into this a long time ago. Using Cypress in interactive mode in Docker requires X11, which I can almost guarantee is more trouble than the current setup, especially across operating systems. I suggest closing this ticket.

@afeld afeld moved this from This Sprint (Month) to Backlog in Digital Services Feb 28, 2023
@thekaveman
Copy link
Member

I think we still want to look into this - not worried so much about getting a complete Cypress graphical interface (requiring X11) - but just being able to run the tests without local NPM madness. Sounds like @angela-tran had a good process working, we'll keep going from there.

@angela-tran
Copy link
Member

This feels shaped enough, just not sure if we need to do it soon. This opens up a larger question of: what should our Cypress tests be covering?

@thekaveman
Copy link
Member

We decided this effort isn't worth it right now. We're going to revisit the idea of these types of UI/UX tests in the near future.

@thekaveman thekaveman closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Digital Services Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. tests Related to automated testing (unit, UI, integration, etc.)
Projects
Archived in project
Development

No branches or pull requests

4 participants