There are advantages to using the API to tear down automated end-to-end tests

When I automate a test I create a clean starting position for each test so that the automated tests can run concurrently. “The establishment of a known-good starting position for the test before it is run, and its re-establishment at its conclusion, is vital to avoid cross-test dependencies”[1].  Re-establishing the start position of the test …

Regular expressions can help you to do more with your automated tests

   “A regular expression defines a set of one or more strings of characters” [1]. Regular expressions (regex) can be used when developing automated tests, for example, by passing a regular expression as a parameter. If you have not used a regular expression before the MDN Web docs are a good place to start learning about …

Ten reasons why you should lint your test automation code

A linter is a static analysis tool that scans source files and reports warnings and errors for the code it scans. I use a linter on the test automation code that I write. The linter tests the code I write without running the code. Here are ten reasons to use a linter on your test …

Benefit from a richer Page Object Model with abstract classes and functions

The Page Object Model we create to support our automated tests can be described as a model of the application we are testing. We can make it a richer model using abstract classes and functions. “classes, methods, and fields in TypeScript may be abstract.An abstract method or abstract field is one that hasn’t had an …

Generic functions help me to reduce the amount of Playwright test automation code

One of the challenges in writing automated tests is to have a low maintenance cost of the tests. Creating a library of functions in a Page Object Model helps because the test can reuse the functions in the library. Typescript generic functions within my Playwright Page Object Model also help me, in some situations, to …

Make your Playwright tests run faster by using the Playwright API to wait

There are times when automating a test in Playwright that the test needs to wait because the test will flake if it does not wait for something such as an event. It can be, for example, that you are waiting for a navigation to complete.  Tests can be made to wait with a ‘wait’ for …

Use code reviews to have discussions about your test automation code

Learning from discussions originating from code reviews is helping me create a pack of automated tests using TypeScript and Playwright.  I have been developing a pack of Playwright tests with a Page Object Model. A simplified example of a page in the Page Object Model looked something like this: A simplified example of a test: …

Do Chromatic tests complement Playwright tests?

I am using Playwright to automate end-to-end tests, and have started to complement my Playwright tests with Chromatic tests.  The Playwright tests are really useful, but each test needs to run through several steps to create a scenario I want to test. Creating a Playwright test for each input variation for each part of the …

If you are weighing up which tool to use for test automation have a look at Playwrights Trace Viewer, it may persuade you to use Playwright

When we are automating and maintaining tests we need good feedback on test runs. Playwright gives quick and useful feedback in its Trace Viewer which provides feedback on the run of tests. Trace Viewer’s feedback is one reason I like automating tests with Playwright. Through Trace Viewer you can: If a Playwright test fails, Trace …

Sometimes you need to assert that Playwright tests are not running too fast!

Tests that are automated in Playwright run fast, which is great. However, sometimes they run so fast that assertions need to be used to stop the test being flaky. Playwright uses Auto-waiting to help it run tests fast. Auto-waiting means that Playwright performs several checks before making an action, for example, it checks that an …

Automated tests do not have to be flaky.

When I create or maintain an automated test I use a “learning loop” so that I learn from the test results. This enables me to create stable test packs that return accurate results.  I automate tests with Playwright using TypeScript and with the low code tool Ghost Inspector. The “learning loop” is the same for …

Design a site like this with WordPress.com
Get started