352
edits
(→Handling shadow DOM: content added) |
|||
Line 81: | Line 81: | ||
== Handling browser instances == | == Handling browser instances == | ||
TBD - mwargers | TBD - mwargers | ||
== Returning the page object after completing an action == | == Returning the page object after completing an action <njpark>== | ||
When invoking a certain UI action causes the phone to open a new page, it is recommended to return the appropriate page object. <br /> | |||
When | On a related note, each page should have its own class definition, where it lists methods that manipulates and checks the associated UI elements. | ||
<br> | |||
<source python> | |||
music_app.wait_for_music_tiles_displayed() | |||
# tapping albums tab returns the list_view object, | |||
# because it opens the new view | |||
list_view = music_app.tap_albums_tab() | |||
# tapping the first album returns the sublist_view object | |||
sublist_view = albums[0].tap_first_album() | |||
# tapping the song opens the player view | |||
player_view = sublist_view.tap_first_song() | |||
# select stop | |||
player_view.tap_play() | |||
</source> |
edits