You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 13, 2025. It is now read-only.
Sonnar is now a TypeScript API for constructing XPath 1.0 expressions
To write maintainable E2E tests, I'm a fan of an abstraction along the lines of the PageObject design pattern. The main point is to decouple the E2E tests from the implementation details of the HTML. My first approach was to create an object-oriented API around string-based CSS selectors. Unfortunately CSS selectors are not powerful enough to allow the kind of modeling I had in mind. Fortunately, there is an alternative called XPath 1.0, which is supported by all major browsers and also by common E2E testing frameworks like Playwright or Puppeteer.