Page Objects: Clean Your Room

Опубликовано: 24 Март 2026
на канале: Lethcode
778
42

Page Objects get brought up as the savior of your End To End tests. But the pattern isn't that hard to implment. That is both good and bad news. It isn't opinionated but that means there is actually some room to do what you want with this pattern.

The advantages of page objects:
Clearly define your actions in your tests.
Reuse your selectors
Allow multiple tests to do common actions

Disadvantages:
If done poorly its just more complicated to run your tests
Disorganized if a class is a utility dump it will be worse than just recoding everything in every test


Example used in this video
https://github.com/alethcoe/Playwrigh...