Merge lp:~elopio/ubuntu-ui-toolkit/closeActionsPopover-test_modules into lp:ubuntu-ui-toolkit/staging

Proposed by Leo Arias
Status: Merged
Approved by: Tim Peeters
Approved revision: 1102
Merged at revision: 1123
Proposed branch: lp:~elopio/ubuntu-ui-toolkit/closeActionsPopover-test_modules
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 332 lines (+196/-89)
4 files modified
tests/autopilot/ubuntuuitoolkit/tests/components/__init__.py (+24/-0)
tests/autopilot/ubuntuuitoolkit/tests/components/test_header.HeaderTestCase.qml (+64/-0)
tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py (+48/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+60/-89)
To merge this branch: bzr merge lp:~elopio/ubuntu-ui-toolkit/closeActionsPopover-test_modules
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tim Peeters Approve
Review via email: mp+223078@code.launchpad.net

This proposal supersedes a proposal from 2014-06-10.

Commit message

Moved the regression autopilot test for the actions popover to the components module.

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

the branch to merge this into already went into our staging. Please resubmit

review: Needs Resubmitting
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1101
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/367/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/847
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/781
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/199
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/199
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/199/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/199
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1261
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1562
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1562/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8396
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/693
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/921
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/921/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/367/rebuild

review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/201/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1212
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1079
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/145
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/145
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/145/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/145
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1545
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2090
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2090/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8858
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/896
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1222
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1222/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

please merge staging

1102. By Leo Arias

Merged with staging.

Revision history for this message
Tim Peeters (tpeeters) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'tests/autopilot/ubuntuuitoolkit/tests/components'
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/__init__.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/__init__.py 2014-06-27 12:16:47 +0000
@@ -0,0 +1,24 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Tests for the Ubuntu UI Toolkit components."""
18
19
20# Note that the feedback loop that you get from testing QML components with
21# Autopilot is bigger than what you would get by doing it with QtTest.
22# So, the QML components need to be tested first in isolation at a lower level
23# with QtTest, leaving Autopilot to test complex user interactions or user
24# stories.
025
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_header.HeaderTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_header.HeaderTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_header.HeaderTestCase.qml 2014-06-27 12:16:47 +0000
@@ -0,0 +1,64 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23
24 useDeprecatedToolbar: false
25
26 PageStack {
27 id: stack
28 Component.onCompleted: stack.push(page)
29
30 Page {
31 title: "Test title"
32 id: page
33
34 tools: ToolbarItems {
35
36 Repeater {
37 id: buttonRepeater
38 model: 5
39 ToolbarButton {
40 action: Action {
41 objectName: "action" + index
42 text: "text " + index
43 iconName: "add"
44 }
45 }
46 }
47
48 ToolbarButton {
49 action: Action {
50 objectName: "pushStackAction"
51 text: "Push page"
52 iconName: "add"
53 onTriggered: stack.push(pushMe)
54 }
55 }
56 }
57 }
58
59 Page {
60 title: "Pushed page"
61 id: pushMe
62 }
63 }
64}
065
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 2014-06-27 12:16:47 +0000
@@ -0,0 +1,48 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Tests for the Ubuntu UI Toolkit Header component."""
18
19import os
20
21from autopilot.matchers import Eventually
22from testtools.matchers import Equals
23
24from ubuntuuitoolkit import tests
25
26
27class HeaderTestCase(tests.QMLFileAppTestCase):
28
29 path = os.path.abspath(__file__)
30 dir_path = os.path.dirname(path)
31 test_qml_file_path = os.path.join(
32 dir_path, 'test_header.HeaderTestCase.qml')
33
34 def setUp(self):
35 super(HeaderTestCase, self).setUp()
36 self.header = self.main_view.get_header()
37
38 def test_click_header_overflow_action_must_close_popover(self):
39 """Test that clicking an action from the popover must close it.
40
41 Regression test for http://pad.lv/1326963
42
43 """
44 overflow_popover = self.main_view.select_single(
45 'Popover',
46 objectName='actions_overflow_popover')
47 self.header.click_action_button('pushStackAction')
48 self.assertThat(overflow_popover.visible, Eventually(Equals(False)))
049
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-16 12:07:41 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-27 12:16:47 +0000
@@ -22,8 +22,6 @@
2222
23import ubuntuuitoolkit23import ubuntuuitoolkit
24from ubuntuuitoolkit import tests24from ubuntuuitoolkit import tests
25from testtools.matchers import Equals
26from autopilot.matchers import Eventually
2725
2826
29class HeaderTestCase(tests.QMLStringAppTestCase):27class HeaderTestCase(tests.QMLStringAppTestCase):
@@ -38,93 +36,73 @@
3836
39 useDeprecatedToolbar: false37 useDeprecatedToolbar: false
4038
41 PageStack {39 Page {
42 id: stack40 title: "Test title"
43 Component.onCompleted: stack.push(page)41
4442 Flickable {
45 Page {43 anchors.fill: parent
46 title: "Test title"44 contentHeight: units.gu(120)
47 id: page45 objectName: "header_test_flickable"
4846
49 Flickable {47 Label {
50 anchors.fill: parent48 id: label
51 contentHeight: units.gu(120)49 objectName: "clicked_label"
52 objectName: "header_test_flickable"50 anchors {
5351 top: parent.top
54 Label {52 horizontalCenter: parent.horizontalCenter
55 id: label53 }
56 objectName: "clicked_label"54 text: "No button clicked."
57 anchors {55 }
58 top: parent.top56
59 horizontalCenter: parent.horizontalCenter57 Button {
60 }58 objectName: "hide_actions_button"
61 text: "No button clicked."59 anchors {
62 }60 top: label.bottom
6361 topMargin: units.gu(5)
64 Button {62 horizontalCenter: parent.horizontalCenter
65 objectName: "hide_actions_button"63 }
66 anchors {64 text: "Hide some actions"
67 top: label.bottom65 onClicked: {
68 topMargin: units.gu(5)66 cancelAction.visible = false;
69 horizontalCenter: parent.horizontalCenter67 for (var i=0; i < 3; i++) {
70 }68 buttonRepeater.itemAt(i).action.visible = false;
71 text: "Hide some actions"69 }
72 onClicked: {70 // only three of five visible actions left
73 cancelAction.visible = false;71 }
74 for (var i=0; i < 3; i++) {72 }
75 buttonRepeater.itemAt(i).action.visible = false;73 Label {
76 }74 id: endLabel
77 // only three of five visible actions left75 objectName: "end_label"
78 }76 anchors {
79 }77 bottom: parent.bottom
80 Label {78 horizontalCenter: parent.horizontalCenter
81 id: endLabel79 }
82 objectName: "end_label"80 text: "The end."
83 anchors {81 }
84 bottom: parent.bottom82 }
85 horizontalCenter: parent.horizontalCenter83
86 }84 tools: ToolbarItems {
87 text: "The end."85 back: ToolbarButton {
88 }86 action: Action {
89 }87 id: cancelAction
9088 iconName: "cancel"
91 tools: ToolbarItems {89 text: "cancel"
92 back: ToolbarButton {90 onTriggered: label.text = "Cancel button clicked."
93 action: Action {91 }
94 id: cancelAction92 }
95 iconName: "cancel"93 Repeater {
96 text: "cancel"94 id: buttonRepeater
97 onTriggered: label.text = "Cancel button clicked."95 model: 5
98 }
99 }
100 Repeater {
101 id: buttonRepeater
102 model: 5
103 ToolbarButton {
104 action: Action {
105 objectName: "action" + index
106 text: "text " + index
107 iconName: "add"
108 onTriggered: {
109 label.text = "Button "+index+" clicked.";
110 }
111 }
112 }
113 }
114 ToolbarButton {96 ToolbarButton {
115 action: Action {97 action: Action {
116 objectName: "pushStackAction"98 objectName: "action" + index
117 text: "Push page"99 text: "text " + index
118 iconName: "add"100 iconName: "add"
119 onTriggered: stack.push(pushMe)101 onTriggered: label.text = "Button "+index+" clicked."
120 }102 }
121 }103 }
122 }104 }
123 }105 }
124 Page {
125 title: "Pushed page"
126 id: pushMe
127 }
128 }106 }
129}107}
130""")108""")
@@ -151,13 +129,6 @@
151 self.header.click_action_button('action3')129 self.header.click_action_button('action3')
152 self.assertEqual(self.label.text, 'Button 3 clicked.')130 self.assertEqual(self.label.text, 'Button 3 clicked.')
153131
154 def test_click_header_overflow_action_closes_popover_bug1326963(self):
155 overflow_popover = self.main_view.select_single(
156 'Popover',
157 objectName='actions_overflow_popover')
158 self.header.click_action_button('pushStackAction')
159 self.assertThat(overflow_popover.visible, Eventually(Equals(False)))
160
161 def test_click_unexisting_header_action_button(self):132 def test_click_unexisting_header_action_button(self):
162 error = self.assertRaises(133 error = self.assertRaises(
163 ubuntuuitoolkit.ToolkitException, self.header.click_action_button,134 ubuntuuitoolkit.ToolkitException, self.header.click_action_button,

Subscribers

People subscribed via source and target branches