Closed Bug 1200392 Opened 9 years ago Closed 9 years ago

Remove wait_for methods in base.py, part 2

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

Details

Attachments

(1 file)

+++ 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.
Attachment #8655927 - Flags: review?(npark)
Attachment #8655927 - Flags: review?(jlorenzo)
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+
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+
Merged: https://github.com/mozilla-b2g/gaia/commit/ce5f660cc2d46fa7387e9cd21b33db1dbf7802d8
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 1201665
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: