Closed
Bug 1242964
Opened 10 years ago
Closed 10 years ago
Document view/accessors model (evolution of the page object pattern)
Categories
(Firefox OS Graveyard :: Gaia::UI Tests, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jlorenzo, Assigned: jlorenzo)
Details
Attachments
(1 file)
Based on the presentation done in Orlando: https://mikehenrty.github.io/talk-marionette-js/#/20
Assignee | ||
Comment 1•10 years ago
|
||
https://wiki.mozilla.org/B2G/QA/Automation/Style_Guide/Best_Practices#Going_further_with_the_Page_Object_pattern
I updated the best practice document with the model. As you all have been dealing with either the Page Object pattern or the view/accessors one, please tell me if anything looks missing, unclear, overkill or false :)
Thanks!
Attachment #8712155 -
Flags: review?(npark)
Attachment #8712155 -
Flags: review?(martijn.martijn)
Attachment #8712155 -
Flags: review?(kglazko)
Attachment #8712155 -
Flags: review?(irios.mozilla)
Attachment #8712155 -
Flags: feedback?(azasypkin)
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #1)
> please tell me if anything looks missing, unclear, overkill or false :)
Or not even correct (from a linguistic point of view included).
![]() |
||
Comment 3•10 years ago
|
||
Looks good to me. In case of Javascript example, shouldn't it return NewMessageView(this.client).displayed() to make it functionally equivalent to the python one?
Assignee | ||
Comment 4•10 years ago
|
||
Good question.
Unlike the name infers, waitForElement() defined in the helper[1], actually waits for it to be displayed.
https://github.com/mozilla-b2g/gaia/blob/2a6e31cdf1dabad180ff9dbc3eddce440d00ca5e/tests/jsmarionette/plugins/marionette-helper/index.js#L145
![]() |
||
Updated•10 years ago
|
Attachment #8712155 -
Flags: review?(npark) → review+
Comment 5•10 years ago
|
||
Johan this doc is great! thank you!
I would only say one thing..I had many troubles trying to switch to the correct frame when moving between apps, was not sure where to do that(accessors, views, apps..), maybe it can be explained where to use, in views, and where not to use, in the test, in the doc? For you guys maybe it is implicit but for beginners like me would be useful :)
Assignee | ||
Comment 6•10 years ago
|
||
Good catch! I'll explain it more and put an example.
Comment 7•10 years ago
|
||
Not sure what a view is, I guess it's a page or a dialog? Perhaps we need an example of a view on that page? I guess a view can be based of a PageRegion.
Comment 8•10 years ago
|
||
Comment on attachment 8712155 [details]
Link to Wiki page
Looks good for the rest.
Attachment #8712155 -
Flags: review?(martijn.martijn) → review+
Updated•10 years ago
|
Attachment #8712155 -
Flags: review?(irios.mozilla) → review+
![]() |
||
Updated•10 years ago
|
Attachment #8712155 -
Flags: review?(kglazko) → review+
![]() |
||
Comment 9•10 years ago
|
||
Makes sense to me!
Comment 10•10 years ago
|
||
Comment on attachment 8712155 [details]
Link to Wiki page
Looks great, thanks for summarizing!
Just few notes:
* "Accessors" subsection: you mentioned that "accessors make sure the element is _not moving_", but I am not really sure that "this.client.helper.waitForElement" from JS example take care of this :)
* "General definition" subsection: looks like in JS example we should have "return new NewMessageView(this.client);" instead of "return NewMessageView(this.client);";
And some minor typos that caught my eye :)
* "Naming" subsection: "... and views implements this detail ..." --> "... and views implement this detail ...";
* "Special cases" subsection: "... Views usually implements ..." --> ""... Views usually implement ..."";
* "Special cases" subsection: "... If one of you integration test ..." --> ""... If one of your integration tests ..."";
* "TL;DR" subsection: "... Apps instantiates ..." --> "... Apps instantiate ...";
* "TL;DR" subsection: "... Accessors bubbles ..." --> "... Accessors bubble ...";
* "TL;DR" subsection: "... and gives it to the test ..." --> "... and give it to the test ...";
And in addition to comment 7 you may want to add that view can be a dialog or activity chooser like we discussed earlier :)
Attachment #8712155 -
Flags: feedback?(azasypkin) → feedback+
Assignee | ||
Comment 11•10 years ago
|
||
Thank you all for your reviews!
(In reply to Isabel Rios[:isabel_rios] from comment #5)
Done at https://wiki.mozilla.org/B2G/QA/Automation/Style_Guide/Best_Practices#Switching_frames
(In reply to Martijn Wargers [:mwargers] (QA) from comment #7)
Discussed on IRC. I put a table for the equivalence between model there https://wiki.mozilla.org/B2G/QA/Automation/Style_Guide/Best_Practices#Equivalence_table
(In reply to Oleg Zasypkin [:azasypkin][⏰UTC+1] from comment #10)
Typo fixed. "new" added. Example modified: https://wiki.mozilla.org/B2G/QA/Automation/Style_Guide/Best_Practices#Accessors
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•