not sure if this is the right place to post this, ...
# seed
k
not sure if this is the right place to post this, but does anyone do any E2E testing when going to a staging environment? Does anyone use cypress or something else? 🙂
f
Hey @Kristian Lake, I’ve seen teams talking about running integration tests inside the Post Deploy phase.
The test runs after the environment is deployed successfully.
k
thanks Frank, I will take a look
o
We are running cypress as our e2e, but in github actions after Seed deploys our stack using Github events.
k
Thanks @Omry Hay - Is there any reason you did not use seed.run for it? I tried to set the Post-Deploy Phase to npm cypress run but it didnt go too well!. Just having a look to see if its possible to use cypress with seed.run
r
You could try installing cypress in the post deploy hook before running the scripts
k
i just tried in the post deploy hook cd frontend && npm install --save-dev start-server-and-test npm install --save-dev http-server npm install --save-dev cypress npm cypress run but still got
Copy code
====================
➡️ Post-Deploy
====================
Copy code
$ cd frontend && npm install --save-dev start-server-and-test
81.67 s
Copy code
$ npm install --save-dev http-server
2.35 s
Copy code
$ npm install --save-dev cypress
3.94 s
Copy code
$ npm cypress run
0.32 s
Copy code
Unknown command: "cypress"
To see a list of supported npm commands, run:
  npm help
ERROR: Failed to run: npm cypress run
realistically I would love to be able to run cypress on the end of seed rather than complicating the ci/cd process with external actions in github. its fantastic that seed.run can do unit and integration testing - but alot of the important tests are done during E2E testing so it would be a shame if its not possible.
r
How about a global -g install?
o
Is there any reason you did not use seed.run for it?
@Kristian Lake - IMO Seed is a CD tool and running Cypress is a bit missing the point there. As other pointed out you can basically run everything in Seed as you have the custom hooks and can run anything, but it’s not a tool that was built for it - also in terms of pricing a minute in GHA is less expensive than Seed’s minute. But also Github action offers a wide range of open source actions you can leverage like Slack integration, visual test results, saving the output of the run like videos and snapshots, creating reports, and also run those e2e in a schedule job in Production. For example, we run e2e in every PR, every merge to master, every deploy to Production and also as scheduled job twice a day on Prod. If there is a failure we save the video recording and images snapshot for debugging in the github action, and create a report using
mochawesome
(save it in S3, but you can also save it in Github action) and send it out in Slack whenever there is a failure. We could do that with Seed, but we will have to develop and write a bunch of code to do it, and it basically not the right tool for the job IMO.
h
@Kristian Lake May be this link will help you about E2E testing with Cypress and Jest. https://dev-academy.teachable.com/p/web-e2e-testing
k
Thanks @Haider Abbas I will take a look. I do have tests running and can create E2E tests with Cypress and Jest - its just adding them into the pipeline so they run tests when we go to other branches.
im going to look into this approach as suggested by @Omry Hay SEED > webhook to github actions > E2E > fail results back to SEED to rollback But need to check if seed has an api i can call for the last step