For years I wanted end-to-end testing for my products, without even knowing what the end result should look like. At this year's Codegarden Paul Seal gave a talk about Accelerating Package Development where he showed that he could validate builds from his phone by looking at screenshots and then it clicked. I just need to review screenshots as the end result of tests running in the CI/CD pipeline using Playwright. Basically that is the same as clicking through a browser and verifying everything works as expected on your screen. Great, now I know what to do but still not how to do it.
In this post I show you how I got there for my SimpleStats package.
Every push builds a throwaway Umbraco 18 site with the default starter kit and SimpleStats installed, Playwright clicks through it and a readable report with screenshots lands on GitHub Pages. And I didn't write any of these tests myself.
My first Claude project
This summer I decided it was time to stop coding myself for my products and let Claude do that part. Best decision ever. It came with a learning curve as always, but now I am more productive than ever before. As a first test to get started I created a package called SimpleStats, a custom extension for the previous version of my weblog. I've written a post on how that got started.
I took the learnings from this and applied them to my other products. Result: more bugfixes, more releases, and that introduced a new problem. Testing.....
For years my final release test was an Excel sheet with tests that a tool needed to pass before I could hit the release to NuGet button. Unit tests prove the C# logic, they don't prove that functionality still works in a real Umbraco site. As a result testing costs more time than fixing bugs or adding functionality.
What if I could...
This pulled me back to Codegarden, where Paul had end-to-end testing set up. I had seen end-to-end testing before on client projects. People used a Playwright extension in their browser, clicked through the whole site, recorded tests from that, checked them into source control.
Then next time some fields in the UI were changed and all tests started to fail then the tester was creating all the tests again in the browser and that repeated several times. I wanted to avoid that plumbing. Since Playwright has a CLI, I wanted to see if I could just instruct Claude what to do.
Let's try to test SimpleStats
I installed the Playwright CLI, the Umbraco Backoffice skills and I installed the umbraco-cms-backoffice-testing-skills. The skills made the difference! Without them Claude guesses how the backoffice works, with them, it knows. The reason I used the CLI instead of the Playwright MCP server is simply because I wanted to avoid spending extra costs on tokens.
Then I just gave Claude the instruction:
Write Playwright tests for this scenario: Start the site, when it is loaded go to the about page twice, wait for 2 minutes, login to the backoffice open the simplestats dashboard and validate homepage is accessed once and about us page twice.
That was it!
Everything needed to run the test came with it as a result: a script that spins up a fresh Umbraco 18 site with The Starter Kit and SimpleStats installed, signs in, and cleans up afterwards.
Of course that was because Claude already knew about the developer install scripts that were available in the repo that contained test username and password as well but still without any knowledge about Playwright I added end-to-end testing in minutes.
Add it to a pipeline
Fine that i was working locally, the real benefit comes when you add this in your build pipeline. When end-to-end testing fails the whole build cannot be released, awesome!
Adding the tests was just another prompt
extend the build pipeline and run the end-to-end tests before the package is pushed and push the result to GitHub pages
To have the result on GitHub Pages you have to allow publish from branches in the settings of your GitHub repository. If you use the GitHub CLI you can ask Claude to do this for you, even easier.