behat-wordpress-extension icon indicating copy to clipboard operation
behat-wordpress-extension copied to clipboard

Separate UI logic from Traits

Open rvodden opened this issue 8 years ago • 1 comments

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:

  1. Contexts should link the steps or tags to the appropriate calls.
  2. 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:

  1. edit_post_page as mentioned above.
  2. UserAwareContextTrait currently has the login and logout code in it. That can very easily be moved to a page - just not sure which one right now.

rvodden avatar Oct 22 '17 08:10 rvodden

Would be keen to have @stephenharris ' views on this.

paulgibbs avatar Oct 22 '17 11:10 paulgibbs