Automate e2e tests in GitHub actions

Mohammad Jawad (Kasir) Barati - Aug 6 - - Dev Community

I was writing E2E tests for this project of mine which is not something really serious, but rather I am doing it as a way to learn and practice my skills. So I though why I am troubling myself with manually testing my E2E tests on my local system. Let's write some tests in jest and then automate it with GitHub actions.

And it is a really nice feeling that you get, you're kinda sure that your codes were not for nothing. But you wrote them and they are tested. So even if the future version of you will be grateful to you for taking the time and automating these tedious, time consuming tasks.

What I am trying to accomplish here is to push you towards writing more tests. Because it:

  1. Boosts health by allowing you to rest well during nights.2. Catch errors ASAP.
  2. Fixing bugs ASAP.
  3. Promoting a quality first culture.
  4. Saving time, and energy where it is most needed (By having quick builds and short feedback loops).
  5. Better UX, happier users.
  6. Enables you to catch recurring bugs/issues, then you can come up with a concrete plan to handle it properly.
  7. And more.

TBF I cannot see one downside to writing tests, exercising TDD practice, and automating your build and tests.

Additional docs + repo

  • If you're curious as to how I did it you can check my repo here.
  • I also documented most important stuff in here.

Feel free to share your thoughts on this in the comments. Looking forward to read your comments.

. . . . . . . . . . . . . . . . . . .