Skip to content

Consider using Page Objects for Playwright tests #3149

Closed
@jawnsy

Description

@jawnsy

Our Playwright end-to-end tests currently hard-code selectors (class names and labels) required to find various DOM objects that we're working with. As the upstream Visual Studio Code does not provide stable identifiers (e.g. id tags) on key buttons, objects, etc, this means that our e2e tests are somewhat prone to breakage whenever the upstream Code project changes.

A technique that can help with this is called Page Objects, introduced by Martin Fowler for Selenium-based tests in 2013. Playwright supports a similar pattern and publishes a guide on how to create these.

We should consider gradually updating our tests to use Page Objects, so that they will be easier to maintain. Since our tests are written in TypeScript, we will likely also benefit from code completion for various common actions, which should simplify the process of writing test cases.

Metadata

Metadata

Assignees

Labels

ciIssues related to cifeatureNew user visible featuretestingAnything related to testing

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions