behat-wordpress-extension
behat-wordpress-extension copied to clipboard
Separate UI logic from Traits
When I implemented #144 I put in a comment that edit_post_page should not be public. This is because I didn't like idea of the traits being coupled to the pages. The way I see it:
- Contexts should link the steps or tags to the appropriate calls.
- Those calls will either be:
- using the backend and therefore using the driver API via the traits or,
- exercising the UI and therefore using the Pages API.
There should, therefore, be no need for the traits to be aware of the pages. The contexts will be aware of both the traits and the pages. I'm only aware of two places the traits have page code:
edit_post_pageas mentioned above.UserAwareContextTraitcurrently has the login and logout code in it. That can very easily be moved to a page - just not sure which one right now.
Would be keen to have @stephenharris ' views on this.