Merge lp:~canonical-platform-qa/unity-scope-click/wait_for_search_button into lp:unity-scope-click
| Status: | Merged |
|---|---|
| Approved by: | dobey on 2015-05-06 |
| Approved revision: | 322 |
| Merged at revision: | 321 |
| Proposed branch: | lp:~canonical-platform-qa/unity-scope-click/wait_for_search_button |
| Merge into: | lp:unity-scope-click |
| Diff against target: |
43 lines (+12/-4) 1 file modified
tests/autopilot/unityclickscope/__init__.py (+12/-4) |
| To merge this branch: | bzr merge lp:~canonical-platform-qa/unity-scope-click/wait_for_search_button |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Approve on 2015-05-06 | |
| dobey (community) | 2015-05-01 | Approve on 2015-05-06 | |
| Vincent Ladeuil (community) | Approve on 2015-05-06 | ||
|
Review via email:
|
|||
Commit Message
Wait for the search button to be available/enabled before trying to click it in the enter_search_query AP helper
Description of the Change
In our sanity tests we sometimes find that our test to install a free application fails because it can't find the search box - this seems likely to be because of a timing issue which means the button hasn't been clicked. Changing a select_single to wait_select_single to see if it helps.
- 319. By Brendan Donegan on 2015-05-01
-
Wait for search button to be available to avoid the possibility it might not be
| dobey (dobey) wrote : | # |
Should not all of the select_single() calls be changed to wait_select_
| Brendan Donegan (brendan-donegan) wrote : | # |
That certainly wouldn't do any harm (in fact I'm of the opinion that select_single should be mapped to wait_select_single in Autopilot)
- 320. By Brendan Donegan on 2015-05-05
-
Wait for the search button to be enabled and use wait_select across the board
| Brendan Donegan (brendan-donegan) wrote : | # |
Turns out I needed to wait for the button to be enabled as well. I updated the other select_singles to as requested by Rodney
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:320
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Leo Arias (elopio) wrote : | # |
On Fri, May 1, 2015 at 8:10 AM, Brendan Donegan <
<email address hidden>> wrote:
> That certainly wouldn't do any harm (in fact I'm of the opinion that
> select_single should be mapped to wait_select_single in Autopilot)
>
I disagree with this. I dislike wait_select_single because generally it
means we don't understand what's happening on the screen. What we should do
in most of the cases is to wait for a loading image to disappear or an
animation to stop. If we use the wait always we will miss some bugs, like:
it takes 10 seconds for a button to appear without any indication on the
screen that the application is not stuck.
Sometimes it's valid to use it of course.
| dobey (dobey) wrote : | # |
On Tue, 2015-05-05 at 14:27 +0000, Leo Arias wrote:
> On Fri, May 1, 2015 at 8:10 AM, Brendan Donegan <
> <email address hidden>> wrote:
>
> > That certainly wouldn't do any harm (in fact I'm of the opinion that
> > select_single should be mapped to wait_select_single in Autopilot)
> >
>
> I disagree with this. I dislike wait_select_single because generally it
> means we don't understand what's happening on the screen. What we should do
> in most of the cases is to wait for a loading image to disappear or an
> animation to stop. If we use the wait always we will miss some bugs, like:
> it takes 10 seconds for a button to appear without any indication on the
> screen that the application is not stuck.
> Sometimes it's valid to use it of course.
We can't possibly understand what's happening on the screen. Neither the
app nor autopilot owns the framebuffer. We should always do
wait_select_single in all cases. Maybe the 10 second timeout is too long
for a lot of actions, but that doesn't mean we should expect some piece
of the UI to be immediately available. Many things will affect how
quickly things happen, and the app itself has very little control over
how quickly that will happen.
There have been times when I've seen even 10 seconds not be enough time,
when running autopilot tests, for the expected thing to happen, which
normally happens very quickly in live usage of an app on a phone, and
that was with using wait_select_single.
There is just no way for any app to be able to guarantee the speed at
which the UI is drawn by other things; especially in the case of scopes,
where the UI is all entirely in a separate app and process anyway.
- 321. By Brendan Donegan on 2015-05-06
-
Wait for page header to be totally visible
| Brendan Donegan (brendan-donegan) wrote : | # |
Pretty sure I found the magic property now. After 20 runs I got no failures related to the original issue (there were 2 related to CPO inheritance and 1 'mystery' failure)
| Brendan Donegan (brendan-donegan) wrote : | # |
I left the wait_selects in for now. I'm inclined to agree with dobey but Leo has a good point as well.
| Vincent Ladeuil (vila) wrote : | # |
PageHeader.... nice catch !
I think that if Leo is correct, waiting for the page header would allow coming back to select_single instead of wait_select_single to demonstrate that the wait_select_single calls were workarounds.
But up to you, I'm fine landing as is.
| Vincent Ladeuil (vila) wrote : | # |
>>>>> Rodney Dawes <email address hidden> writes:
> On Tue, 2015-05-05 at 14:27 +0000, Leo Arias wrote:
>> On Fri, May 1, 2015 at 8:10 AM, Brendan Donegan <
>> <email address hidden>> wrote:
>>
>> > That certainly wouldn't do any harm (in fact I'm of the opinion that
>> > select_single should be mapped to wait_select_single in Autopilot)
>> >
>>
>> I disagree with this. I dislike wait_select_single because generally it
>> means we don't understand what's happening on the screen. What we should do
>> in most of the cases is to wait for a loading image to disappear or an
>> animation to stop. If we use the wait always we will miss some bugs, like:
>> it takes 10 seconds for a button to appear without any indication on the
>> screen that the application is not stuck.
>> Sometimes it's valid to use it of course.
> We can't possibly understand what's happening on the screen.
Famous last words ;-)
I sincerely hope we, as humans, can understand how things work and find
the right spot to confirm the *app* has reach a specific state instead
of checking for all *widgets* to reach a specific state. That's one key
point of the page object model right ?
Vincent
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:321
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Leo Arias (elopio) wrote : | # |
8- store_scope.
I wouldn't remove this one. I would leave the two waits.
About the waits, I'm also ok leaving them. I don't fully disagree with dobey, because I'm talking about an ideal scenario where design gives us details about each transition. Every time there's a transition that takes 1 second or more, there should be an indication on the screen. We wait for that indication, and afterwards we know the screen is ready and we don't need to wait for anything else.
So I'd say we can't possibly understand what's happening on the screen *now*
| Brendan Donegan (brendan-donegan) wrote : | # |
Actually it has next to no value - isCurrent becomes True immediately when
the animation starts so doesn't correspond with the button being ready to
click. I suppose it doesn't do any harm though
On Wed, May 6, 2015 at 3:54 PM, Leo Arias <email address hidden> wrote:
> 8- store_scope.
>
> I wouldn't remove this one. I would leave the two waits.
>
> About the waits, I'm also ok leaving them. I don't fully disagree with
> dobey, because I'm talking about an ideal scenario where design gives us
> details about each transition. Every time there's a transition that takes 1
> second or more, there should be an indication on the screen. We wait for
> that indication, and afterwards we know the screen is ready and we don't
> need to wait for anything else.
> So I'd say we can't possibly understand what's happening on the screen
> *now*
> --
>
> https:/
> Your team Canonical Platform QA Team is subscribed to branch
> lp:~canonical-platform-qa/unity-scope-click/wait_for_search_button.
>
- 322. By Brendan Donegan on 2015-05-06
-
Final attempt using the store_scope globalRect.y attribute
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:322
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Brendan Donegan (brendan-donegan) wrote : | # |
Okay I'm quite confident this does the right thing now.

PASSED: Continuous integration, rev:319 jenkins. qa.ubuntu. com/job/ unity-scope- click-ci/ 586/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- vivid/863/ console jenkins. qa.ubuntu. com/job/ unity-scope- click-vivid- amd64-ci/ 42 jenkins. qa.ubuntu. com/job/ unity-scope- click-vivid- armhf-ci/ 43 jenkins. qa.ubuntu. com/job/ unity-scope- click-vivid- armhf-ci/ 43/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-vivid/ 691/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-amd64/ 1032 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-amd64/ 1032/artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scope-click- ci/586/ rebuild
http://