Introducing the Page Object Pattern with CodeCeptJS

If your automated test code is unwieldy and repetitive, this is the talk for you! Page Objects hide (encapsulate) details of a page’s structure and workings from the actual test code. No more painstakingly listing every step of every page! Assertions take center stage in the test code.

Code smells aren’t just for production code, they exist in automated test code as well. Automated tests are repetitive by nature (hello login screens). Automated front-end tests describe an application from the user’s perspective. Some tests contain too much information about the structure and workings of a page. The Page Object pattern introduces encapsulation to automated test code. A page’s fields are all described in one place and available to every test. Repeated steps become reusable functions. Assertions take their rightful spot as the focus of test code.