https://cypress.io logo
Using Cypress for continuous E2E testing on a production server
c

cuddly-room-47340

05/25/2023, 3:55 AM
Hi. We have a production server using the forms of a third-party provider. It happened that some of those forms stopped working for various reasons. Due to the partial failure it took too long until the problem was detected and localized. Our idea is now to continuously test all forms at least once a day, fully automated. And for various reasons I would love to use Cypress for that. But, there are two challenges. 1. Running Cypress on an external Node server: It would be an excellent workflow to develop the tests locally and publish them through Node on a testing server. But, for instance, Heroku seems incapable of running Cypress fully. Is there a Node server we can use that fully supports Cypress? 2. After each test, we would like to send the results to a number of people. Is there a way to send such a report, ideally the test results as text and with a link to the video recordings? Maybe using Selenium is the better choice for this task. What do you think? I really would prefer Cypress, as it has become my No. 1 testing tool.
m

many-airline-45402

05/25/2023, 6:01 AM
Hi @cuddly-room-47340 You can find a list of CI providers on https://docs.cypress.io/guides/continuous-integration/ci-provider-examples. Heroku is listed on https://github.com/cypress-io/cypress-example-kitchensink as well. I don't have any personal experience with Heroku, so I can't comment about whether it works correctly or not.
c

cuddly-room-47340

05/25/2023, 6:08 AM
@many-airline-45402 Thanks for the list. I fear that those CI providers only can work in a deployment workflow, but not on on a time schedule. I'll definitely have a look at some of those. Regarding Heroku there is also information on the web that Cypress dropped official support and that it's difficult to get running it on Heroku.
m

many-airline-45402

05/25/2023, 6:18 AM
See https://github.com/cypress-io/github-action#nightly-tests for regularly running tests based on a cron schedule. If you have any up-to-date information which says that Heroku no longer works with Cypress, please post a link.
You can see the results of the example running daily on https://github.com/cypress-io/github-action/actions/workflows/example-cron.yml
Maybe we can use Heroku with a Cypress Docker container: https://resilient-tech.medium.com/cypress-on-heroku-57cee21bc779
m

many-airline-45402

05/25/2023, 9:07 AM
Do you have a preference of using Heroku instead of GitHub Actions? For GitHub Actions we have working examples already. For Heroku it may be possible with a container, you would need to try that out yourself.
https://devcenter.heroku.com/articles/heroku-ci says: "Currently, it is not possible to use Heroku CI to test container builds."
@cuddly-room-47340 Many thanks for linking to the closed kitchensink issue! I have opened a new one in that repo to either update or remove the example as it currently is three years out-of-date. https://github.com/cypress-io/cypress-example-kitchensink/issues/681
c

cuddly-room-47340

05/25/2023, 11:09 AM
The only reason why I would prefer Heroku is because I already work with it and find the deployment of new code super easy. I have not used GitHub Actions before (shame on me), so I'll be in uncharted waters.
m

many-airline-45402

05/25/2023, 11:22 AM
If you are already using Heroku, then that is understandable. In that case I would search for "cron" in the Heroku documents and see if any of the results fit your needs and setup. You might also be able to use https://github.com/cypress-io/cypress-example-kitchensink/blob/master/basic/app.json updated to current versions - I can't give you any guarantee on that though.
c

cuddly-room-47340

05/25/2023, 12:18 PM
Scheduling will probably be easy to implement on Heroku. Its running Cypress in headless mode with a full browser that might not be working.
I'll build a test setup on Heroku and will let you know it it works.
g

gray-kilobyte-89541

05/25/2023, 1:19 PM
I would personally switch to GitHub Actions https://glebbahmutov.com/blog/trying-github-actions and never look back (and I say this as someone who has used Heroku a lot before and while working at Cypress)
m

many-airline-45402

05/26/2023, 5:41 PM
@cuddly-room-47340 If you are considering using the Cypress
github-action
, the current documentation is on https://docs.cypress.io/guides/continuous-integration/github-actions and in the repo itself https://github.com/cypress-io/github-action/blob/master/README.md.
c

cuddly-room-47340

05/26/2023, 5:51 PM
Can I run my own schedules with GitHub Actions?
m

many-airline-45402

05/26/2023, 5:55 PM
c

cuddly-room-47340

05/26/2023, 5:55 PM
Yes. Found it 🙂
@many-airline-45402 and @gray-kilobyte-89541 I can confirm that it works fine with GitHub Actions, including the scheduler 🙂
Do i have to close the post now?