jpriddle

/work / A2 Playwright

A2 Playwright

A2 Hosting, Inc

Director of Development

Aug 2024 - Sep 2024 ·
CI/CD End-to-End Testing GitHub Actions JavaScript Node.js Playwright Slack

A2 Playwright is an end-to-end browser testing framework I built for A2 Hosting’s critical customer-facing web applications. It covers GoCart (the shopping cart and order form), WHMCS (client management), and TurboHub (the WordPress management platform). I designed the full system — test architecture, CI/CD pipeline, Slack alerting, and documentation — then handed it off to a QA engineer on my team to maintain and expand.

As Director of Development, I built this myself to solve a real operational problem: our marketing team deployed changes to the GoCart shopping cart regularly, and bad deploys were silently breaking the order form. We had no automated way to know until customers reported issues or revenue dipped. I got hands-on because the problem was urgent and the solution needed to be built fast, correctly, and in a way that the team could sustain without me.

Problem Solved

GoCart is the entry point for every A2 Hosting sale. Marketing frequently pushed updates — new promotions, layout changes, copy updates — and occasionally those deploys broke the order flow. A customer hitting a broken checkout page means lost revenue with zero visibility. There was no automated regression testing, no deploy-time validation, and no alerting. The team only found out when something was obviously wrong or a customer complained.

I needed a system that would automatically run tests against the live cart after every deploy, alert the team immediately on failure with enough context to act on it, and be simple enough for a QA engineer (not a framework expert) to maintain and extend.

Architecture

The project is structured around Playwright’s multi-project configuration, with each A2 application treated as a separate project with its own test directory, fixtures, and page objects.

Test Organization:

Library Layer:

CI/CD Pipeline

The CI setup was the most interesting part of this project, and the piece I designed specifically for the GoCart deploy problem.

Workflow Design:

The main ci.yml workflow supports four trigger modes: push to master, pull requests, manual dispatch via the GitHub UI or gh CLI, and — critically — calls from other repositories. This last mode is what made it useful for GoCart. When the marketing team deployed changes to the cart, their repository’s deploy workflow would trigger A2 Playwright’s CI to run the GoCart test suite against the live site.

Workflow Dispatch Inputs:

Each application also has its own wrapper workflow (gocart.yml, turbohub.yml, whmcs.yml) for convenient one-click runs.

Scheduled Runs:

A daily schedule runs tests tagged with @scheduled/daily at 8:13 AM Eastern. Tests opt in to scheduling via Playwright’s tag system, so critical flows like live order submission run every morning as a canary.

Execution Details:

Slack Alerting

The Slack integration was key to making this operationally useful. A custom Playwright reporter (lib/slack_reporter/) fires on test failures and sends structured messages to project-specific Slack channels.

How it works:

This meant that when marketing deployed a change that broke the order form, the team had a Slack notification within minutes pointing to exactly what failed and where to look in the codebase.

GoCart Integration

The GoCart use case drove the entire project. The test suite covers the full order funnel:

The live_orders flag was important — we could run the suite in dry mode for CI validation, but flip it on for real end-to-end verification that an order actually makes it through the billing system.

Handoff

I built the project from August through mid-October 2024. The codebase was intentionally designed for handoff: page objects keep UI interactions isolated from test logic, fixtures handle setup boilerplate, and the CI workflows are parameterized so adding a new application means adding a test directory, a fixture file, and a wrapper workflow.

I wrote three internal docs to support the transition: a GitHub Actions usage guide with examples for every trigger mode, a guide for adding new test projects, and a GitHub App authentication guide for cross-repository workflow triggers.

A QA engineer on my team took over active development in mid-October 2024 and picked up ownership easily, continuing to build on the same architecture and patterns I established.