Page Object Example
This directory demonstrates a simple setup for a wdio test suite with page objects. There is a page object for each page that gets tested + a parent page (
page.js) object that contains all important selectors and methods each page object should inherit from. As you can see the page objects are created using
Object.create in order to enable easy inheritance between pages and their selectors.
The goal behind this pattern is to abstract any page information away from the actual tests. Ideally you should store all selectors or specific instructions that are unique for a certain page in a page controller, so that you still can run your test after you've completely redesigned your page and fixed all selectors in the page object.
To run the test, change into this directory:
$ cd ./examples/pageobject
And run the demo:
$ npm test