Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using Page Objects for Playwright tests #3149

Closed
jawnsy opened this issue Apr 16, 2021 · 0 comments · Fixed by #3169
Closed

Consider using Page Objects for Playwright tests #3149

jawnsy opened this issue Apr 16, 2021 · 0 comments · Fixed by #3169
Assignees
Labels
ci Issues related to ci feature New user visible feature testing Anything related to testing
Milestone

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Apr 16, 2021

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.

@jawnsy jawnsy added feature New user visible feature ci Issues related to ci labels Apr 16, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Apr 16, 2021
@jsjoeio jsjoeio self-assigned this Apr 22, 2021
@jsjoeio jsjoeio linked a pull request Apr 22, 2021 that will close this issue
11 tasks
@jsjoeio jsjoeio added the testing Anything related to testing label May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Issues related to ci feature New user visible feature testing Anything related to testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants