Stop using Page Objects and Start using App Actions

Gleb Bahmutov, PhD

VP of Engineering, Cypress.io

$ git clone https://github.com/bahmutov/test-todomvc-using-app-actions.git
$ cd test-todomvc-using-app-actions
$ npm install
$ npm start

Let's test TodoMVC

$ npm install -D cypress

Cypress = end-to-end tests are fun

Final Thoughts

Page Objects = build on top of unstable DOM 🙁

Final Thoughts

App Actions

  • Tied to app's internal API

  • Keep tests focused on feature X

  • Fast

App Actions

📰 "Stop using Page Objects and Start using App Actions" at

Thank you

Stop using Page Objects and Start using App Actions

By Gleb Bahmutov

Stop using Page Objects and Start using App Actions

Writing maintainable end-to-end tests is challenging. Often testers create another layer of indirection on top of the web page called page objects to execute common actions. In this presentation, I argue that page objects are a bad practice, and suggest dispatching actions directly to the application’s internal logic. This works great with a modern test runner like Cypress.io that runs the test code directly alongside the application’s code inside the browser.

  • 132
Loading comments...

More from Gleb Bahmutov