Merge lp:~elopio/ubuntuone-testing/testability-wizard into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Merged
Approved by: Rick McBride
Approved revision: 94
Merged at revision: 91
Proposed branch: lp:~elopio/ubuntuone-testing/testability-wizard
Merge into: lp:ubuntuone-testing
Prerequisite: lp:~elopio/ubuntuone-testing/testability-devices
Diff against target: 185 lines (+101/-10)
5 files modified
ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb (+2/-2)
ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb (+5/-1)
ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb (+10/-0)
ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb (+2/-6)
ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb (+82/-1)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/testability-wizard
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+102428@code.launchpad.net

Commit message

Added the wizard actions.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

Added the wizard actions.

Revision history for this message
Rick McBride (rmcbride) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb'
2--- ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb 2012-04-18 03:38:17 +0000
3+++ ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb 2012-04-18 03:38:17 +0000
4@@ -40,8 +40,8 @@
5 # Execute the application
6 @controlpanel = $SUT.run(:name=>'python',
7 :start_command=>'ubuntuone-control-panel-qt ' +
8- '-testability',
9- :sleep_time=>5)
10+ '-testability')
11+ login
12 wait_for_control_panel
13 end
14
15
16=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb'
17--- ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb 2012-04-18 03:38:17 +0000
18+++ ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb 2012-04-18 03:38:17 +0000
19@@ -18,6 +18,8 @@
20 =end
21
22 require '../run-tests.rb' unless $INIT_COMPLETED
23+require $actions_path + '/wizard.rb'
24+require $actions_path + '/controlpanel.rb'
25 require $actions_path + '/header.rb'
26
27 # Test Suite
28@@ -39,6 +41,8 @@
29 @controlpanel = $SUT.run(:name=>'python',
30 :start_command=>'ubuntuone-control-panel-qt ' +
31 '-testability')
32+ login
33+ wait_for_control_panel
34 end
35
36 # Run after each test case completes
37@@ -51,7 +55,7 @@
38 test "Disconnect from service" do
39 connect_and_wait_for_file_sync_update
40 disconnect
41- verify_true(3, 'test disconnected') {
42+ verify_true(3, 'Test disconnected') {
43 is_disconnected?
44 }
45 end
46
47=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb'
48--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb 2012-04-18 03:38:17 +0000
49+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb 2012-04-18 03:38:17 +0000
50@@ -17,6 +17,16 @@
51 */
52 =end
53
54+def wait_for_information
55+ begin
56+ @controlpanel.wait_child({:type=>'LoadingOverlay'}, 3)
57+ verify_not(30, 'Information not loaded') {
58+ @controlpanel.LoadingOverlay(:visible=>'true')
59+ }
60+ rescue MobyBase::SyncTimeoutError
61+ end
62+end
63+
64 def click_yes_on_dialog_button
65 @controlpanel.QDialogButtonBox(:name=>'qt_msgbox_buttonbox').QPushButton(:text=>'&Yes').tap
66 end
67
68=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb'
69--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb 2012-04-18 03:38:17 +0000
70+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb 2012-04-18 03:38:17 +0000
71@@ -17,6 +17,8 @@
72 */
73 =end
74
75+require $actions_path + '/common.rb'
76+
77 def is_control_panel_visible?
78 return @controlpanel.QWidget(:name=>'management'). \
79 attribute('visible') == 'true'
80@@ -27,12 +29,6 @@
81 wait_for_tab_bar
82 end
83
84-def wait_for_information
85- verify_not(30, 'Information not loaded') {
86- @controlpanel.LoadingOverlay(:name=>'Form')
87- }
88-end
89-
90 def wait_for_tab_bar
91 verify_equal('true', 10, 'Tab bar not displayed') {
92 get_tab_bar.attribute('visible')
93
94=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb'
95--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb 2012-04-18 03:38:17 +0000
96+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb 2012-04-18 03:38:17 +0000
97@@ -17,6 +17,87 @@
98 */
99 =end
100
101+require $actions_path + '/common.rb'
102+
103 def is_wizard_visible?
104- return @controlpanel.UbuntuOneWizard.attribute('visible') == 'true'
105+ begin
106+ @controlpanel.wait_child({:type=>'UbuntuOneWizard',
107+ :visible=>'true'},
108+ 3)
109+ return true
110+ rescue MobyBase::SyncTimeoutError
111+ return false
112+ end
113+end
114+
115+def login
116+ if is_wizard_visible?
117+ sign_me_in_with_my_existing_account
118+ sync_the_cloud_to_your_computer
119+ sync_your_computer_with_the_cloud
120+ end
121+end
122+
123+def sign_me_in_with_my_existing_account
124+ verify_true {
125+ is_wizard_on_sign_in_page?
126+ }
127+ click_login_button
128+ # TODO SSO log in.
129+ puts 'Log in. You have 30 seconds.'
130+ verify_true(30) {
131+ is_wizard_on_the_sync_cloud_to_computer_page?
132+ }
133+end
134+
135+def is_wizard_on_sign_in_page?
136+ return @controlpanel.SignInPanel.attribute('visible') == 'true'
137+end
138+
139+def click_login_button
140+ get_login_button.tap
141+end
142+
143+def get_login_button
144+ return @controlpanel.QPushButton(:name=>'login_button')
145+end
146+
147+def sync_the_cloud_to_your_computer
148+ verify_true {
149+ is_wizard_on_the_sync_cloud_to_computer_page?
150+ }
151+ wait_for_information
152+ click_next_button
153+end
154+
155+def is_wizard_on_the_sync_cloud_to_computer_page?
156+ return @controlpanel.CloudToComputerPage.attribute('visible') == 'true'
157+end
158+
159+def click_next_button
160+ get_next_button.tap
161+end
162+
163+def get_next_button
164+ return @controlpanel.QPushButton(:name=>'__qt__passive_wizardbutton1')
165+end
166+
167+def sync_your_computer_with_the_cloud
168+ verify_true {
169+ is_wizard_on_the_sync_computer_to_cloud_page?
170+ }
171+ wait_for_information
172+ click_finish_button
173+end
174+
175+def is_wizard_on_the_sync_computer_to_cloud_page?
176+ return @controlpanel.ComputerToCloudPage.attribute('visible') == 'true'
177+end
178+
179+def click_finish_button
180+ get_finish_button.tap
181+end
182+
183+def get_finish_button
184+ return @controlpanel.QPushButton(:text=>'&Finish')
185 end

Subscribers

People subscribed via source and target branches