Remove wait_for methods in base.py, part 2

RESOLVED FIXED

Status

Firefox OS
Gaia::UI Tests
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Martijn Wargers (dead), Assigned: Martijn Wargers (dead))

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
+++ This bug was initially created as a clone of Bug #1194275 +++

http://mxr.mozilla.org/gaia/search?string=wait_for_element_present
http://mxr.mozilla.org/gaia/search?string=wait_for_element_not_present&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=gaia
http://mxr.mozilla.org/gaia/search?string=wait_for_element_displayed&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=gaia
http://mxr.mozilla.org/gaia/search?string=wait_for_element_not_displayed&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=gaia
http://mxr.mozilla.org/gaia/search?string=wait_for_condition&find=&findi=&filter=^[^\0]*%24&hitlimit=&tree=gaia

From bug 1074117, comment 1:
"
Doing this in one go will be a large amount of work and will require a large review and testing effort. Let's take each app object as a separate patch. This patch is for the Camera app object. The final patch should be able to remove the majority of wait_for_ methods in the test class and base page class.

I did a bit of analysis over the changes in this patch. This reduces the number of method calls by 12,337 (~4%) and specifically reduces the number of times we call find_element by ~14%. While the impact on total time is difficult to measure, it's likely to be a positive (if negligible) effect.
"

Also gaia_test.py is using various wait_for methods that should be removed according to this comment, but I'll just concentrate on removing from base.py first.

The pull request from bug 1194275 landed. In this bug I'll try to handle the rest.
Created attachment 8655927 [details] [review]
[gaia] mwargers:1200392 > mozilla-b2g:master
(Assignee)

Updated

2 years ago
Attachment #8655927 - Flags: review?(npark)
Attachment #8655927 - Flags: review?(jlorenzo)
(Assignee)

Comment 2

2 years ago
wait_for_condition from gaia_test.py is used a lot, so I waited on converting that.
I think it would also be good to remove is_element_displayed/is_element_present from gaia_test.py. Cases that need this could use the app object, which can use the method from base.py.
Comment on attachment 8655927 [details] [review]
[gaia] mwargers:1200392 > mozilla-b2g:master

r+, modulo the 2 potential missing removals: https://github.com/mozilla-b2g/gaia/pull/31651/files#r38532995
Attachment #8655927 - Flags: review?(jlorenzo) → review+
(Assignee)

Comment 4

2 years ago
Updated the pull request to add those 2 cases. I also had to fix some stupid mistakes I made.
Comment on attachment 8655927 [details] [review]
[gaia] mwargers:1200392 > mozilla-b2g:master

LGTM
Attachment #8655927 - Flags: review?(npark) → review+
(Assignee)

Comment 6

2 years ago
Merged: https://github.com/mozilla-b2g/gaia/commit/ce5f660cc2d46fa7387e9cd21b33db1dbf7802d8
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 years ago
Depends on: 1201665
You need to log in before you can comment on or make changes to this bug.