Merge lp:~osomon/webbrowser-app/workaround-bug-1417118 into lp:webbrowser-app

Proposed by Olivier Tilloy on 2015-02-04
Status: Merged
Approved by: Olivier Tilloy on 2015-02-17
Approved revision: 900
Merged at revision: 904
Proposed branch: lp:~osomon/webbrowser-app/workaround-bug-1417118
Merge into: lp:webbrowser-app
Diff against target: 86 lines (+17/-11)
4 files modified
README (+1/-1)
debian/control (+4/-4)
tests/autopilot/webbrowser_app/emulators/browser.py (+5/-2)
tests/autopilot/webbrowser_app/tests/test_addressbar_states.py (+7/-4)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/workaround-bug-1417118
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-02-17
Riccardo Padovani (community) Approve on 2015-02-04
Ubuntu Phablet Team 2015-02-04 Pending
Review via email: mp+248564@code.launchpad.net

Commit Message

Work around autopilot test failure by ensuring that the selection is cleared before clicking on the action button.

To post a comment you must log in.
Riccardo Padovani (rpadovani) wrote :

 autopilot3 run webbrowser_app.tests.test_addressbar_states.TestAddressBarStates.test_looses_focus_when_reloading
Loading tests from: /home/rpadovani/Documents/ubuntu/touch/system-apps/webbrowser-app/workaround-bug-1417118/tests/autopilot

Tests running...
<class 'Xlib.protocol.request.QueryExtension'>

Ran 1 test in 4.467s
OK

###

vivid on amd64

Thanks!

review: Approve
Olivier Tilloy (osomon) wrote :

Thanks for testing Riccardo :)
However this is not an acceptable fix. I merely submitted it as a MR to have a complete CI run on it to see if it resolves the issue in otto. If it does, we’ll still need to figure out what the root cause of the issue is, and fix it properly.

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
895. By Olivier Tilloy on 2015-02-04

Revert previous revision.

896. By Olivier Tilloy on 2015-02-04

Remove autopilot-touch runtime dependency.
It was originally added as a convenience for when I want to run test packages on a device with phablet-test-run.

PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:896
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/1444/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/1171
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-vivid/539/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-vivid-amd64-ci/202
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-vivid-armhf-ci/202
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-vivid-armhf-ci/202/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-vivid-i386-ci/202
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/1031
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/1169
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/1169/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/17766
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-vivid/436/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/648
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/648/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/1444/rebuild

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
897. By Olivier Tilloy on 2015-02-05

Click somewhere in the leftmost half of the action button to ensure the event is not intercepted by the text selection handle.

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
898. By Olivier Tilloy on 2015-02-06

Updated README with runtime dependencies needed for autopilot tests.

899. By Olivier Tilloy on 2015-02-06

More robust workaround.

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
900. By Olivier Tilloy on 2015-02-17

Yet another workaround for bug #1417118: on devices, clicking again in the address bar might trigger the context menu to show instead of clearing the selection as initially expected.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2014-10-08 22:46:55 +0000
3+++ README 2015-02-17 20:52:43 +0000
4@@ -43,7 +43,7 @@
5 = Automated UI tests =
6
7 webbrowser-app uses autopilot (https://launchpad.net/autopilot) to test its UI.
8-To run the tests, you will need to install python3-autopilot and libautopilot-qt.
9+To run the tests, you will need to install python3-autopilot and autopilot-qt5.
10 Then do the following:
11
12 $ cd tests/autopilot/
13
14=== modified file 'debian/control'
15--- debian/control 2015-02-03 11:06:09 +0000
16+++ debian/control 2015-02-17 20:52:43 +0000
17@@ -129,8 +129,8 @@
18 Architecture: all
19 Multi-Arch: foreign
20 Depends: ${misc:Depends},
21- autopilot-touch,
22- libqt5test5,
23+ autopilot-qt5,
24+ python3-autopilot,
25 python3-fixtures,
26 ubuntu-ui-toolkit-autopilot,
27 webbrowser-app (>= ${binary:Version}),
28@@ -143,8 +143,8 @@
29 Architecture: all
30 Multi-Arch: foreign
31 Depends: ${misc:Depends},
32- autopilot-touch,
33- libqt5test5,
34+ autopilot-qt5,
35+ python3-autopilot,
36 python3-fixtures,
37 ubuntu-ui-toolkit-autopilot,
38 webapp-container (>= ${binary:Version}),
39
40=== modified file 'tests/autopilot/webbrowser_app/emulators/browser.py'
41--- tests/autopilot/webbrowser_app/emulators/browser.py 2014-12-18 18:39:58 +0000
42+++ tests/autopilot/webbrowser_app/emulators/browser.py 2015-02-17 20:52:43 +0000
43@@ -177,8 +177,11 @@
44 def write(self, text, clear=True):
45 self.text_field.write(text, clear)
46
47- def get_action_button(self):
48- return self.select_single("QQuickMouseArea", objectName="actionButton")
49+ @autopilot.logging.log_action(logger.info)
50+ def click_action_button(self):
51+ button = self.select_single("QQuickMouseArea",
52+ objectName="actionButton")
53+ self.pointing_device.click_object(button)
54
55 def get_bookmark_toggle(self):
56 return self.select_single("QQuickItem", objectName="bookmarkToggle")
57
58=== modified file 'tests/autopilot/webbrowser_app/tests/test_addressbar_states.py'
59--- tests/autopilot/webbrowser_app/tests/test_addressbar_states.py 2015-01-23 11:32:11 +0000
60+++ tests/autopilot/webbrowser_app/tests/test_addressbar_states.py 2015-02-17 20:52:43 +0000
61@@ -21,11 +21,10 @@
62
63 def test_cancel_state_loading(self):
64 address_bar = self.main_window.address_bar
65- action_button = address_bar.get_action_button()
66 url = self.base_url + "/wait/5"
67 self.main_window.go_to_url(url)
68 address_bar.loading.wait_for(True)
69- self.pointing_device.click_object(action_button)
70+ address_bar.click_action_button()
71 address_bar.loading.wait_for(False)
72
73 def test_state_editing(self):
74@@ -47,6 +46,10 @@
75 address_bar = self.main_window.address_bar
76 self.pointing_device.click_object(address_bar)
77 address_bar.activeFocus.wait_for(True)
78- action_button = address_bar.get_action_button()
79- self.pointing_device.click_object(action_button)
80+ # Work around https://launchpad.net/bugs/1417118 by clearing the
81+ # address bar and typing again the current URL to enable the reload
82+ # button.
83+ address_bar.clear()
84+ address_bar.write(self.url)
85+ address_bar.click_action_button()
86 address_bar.activeFocus.wait_for(False)

Subscribers

People subscribed via source and target branches

to status/vote changes: