Introduction

For test automation for Angular applications, the book "Testing Angular Applications" by Jesse Palmer et al is a godsend. It covers the test environments of choice for Angular : the unit testing environment with Jasmine and Karma, and its end to end testing environment (e2e) called Protractor.

Github

This project started two years after the book was published. Consequently the Github had lacked maintainance, and the Circleci code for Chapter 11 failed. Below is a quick view of the forked Github repository. Note there is a live link to the corresponding CircleCI page

CircleCi

Instead of just fixing the config.yml that ran a few selected tests, I rewrote it to run all the unit and e2e tests on Linux so as to provide a regression base. This came in handy when failures in my production project allowed me to check that nothing in Protractor had changed or regressed. The main "build_all_platform" pipeline consists of two sequential jobs, "buildtest_linux" and "build_test_windows". My free CircleCi account does not permit parallel execution, so I deliberately made them sequential to avoid running into account issues.

Linux Build and Test

The CircleCi Linux Docker job is named "buildtest_linux". Below is the build part of the "buildtest_linux" job, under the Steps tab. It lists each of the steps needed to build and run the tests. Note there are several "Uploading test results" to harvests the test results from each chapter.

The Test tab shows the results of running all the unit and e2e tests.

Windows Build and Test

The corresponding Windows VM job, named "buildtest_windows" is a placeholder. Unfortunately the Windows VM did not have Chrome installed, so only the test structural template is working, but the unit and e2e tests have been disabled. With a view towards maintanability, the steps of the Windows machine are exactly the same as Linux, and use bash instead of cmd or Powershell.

Conclusion

Currently, I develop and run the tests locally on my Windows 10 PC. When my fixes are checked into Github, the CircleCi tests on Linux to ensure they still pass. In the future, when there is better support for Windows on CircleCi, the "buildtest_windows" will be updated to run the tests in Windows.

References

justgive.org