Introducing the Page Object Pattern with CodeCeptJS
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.