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
=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb'
--- ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb 2012-04-18 03:38:17 +0000
+++ ubuntuone/client/qt/tests/testabilitydriver/controlpanel/devices.rb 2012-04-18 03:38:17 +0000
@@ -40,8 +40,8 @@
40 # Execute the application 40 # Execute the application
41 @controlpanel = $SUT.run(:name=>'python',41 @controlpanel = $SUT.run(:name=>'python',
42 :start_command=>'ubuntuone-control-panel-qt ' +42 :start_command=>'ubuntuone-control-panel-qt ' +
43 '-testability',43 '-testability')
44 :sleep_time=>5)44 login
45 wait_for_control_panel45 wait_for_control_panel
46 end46 end
4747
4848
=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb'
--- ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb 2012-04-18 03:38:17 +0000
+++ ubuntuone/client/qt/tests/testabilitydriver/controlpanel/header-tests.rb 2012-04-18 03:38:17 +0000
@@ -18,6 +18,8 @@
18=end18=end
1919
20require '../run-tests.rb' unless $INIT_COMPLETED20require '../run-tests.rb' unless $INIT_COMPLETED
21require $actions_path + '/wizard.rb'
22require $actions_path + '/controlpanel.rb'
21require $actions_path + '/header.rb'23require $actions_path + '/header.rb'
2224
23# Test Suite25# Test Suite
@@ -39,6 +41,8 @@
39 @controlpanel = $SUT.run(:name=>'python',41 @controlpanel = $SUT.run(:name=>'python',
40 :start_command=>'ubuntuone-control-panel-qt ' +42 :start_command=>'ubuntuone-control-panel-qt ' +
41 '-testability')43 '-testability')
44 login
45 wait_for_control_panel
42 end46 end
4347
44 # Run after each test case completes48 # Run after each test case completes
@@ -51,7 +55,7 @@
51 test "Disconnect from service" do55 test "Disconnect from service" do
52 connect_and_wait_for_file_sync_update56 connect_and_wait_for_file_sync_update
53 disconnect57 disconnect
54 verify_true(3, 'test disconnected') {58 verify_true(3, 'Test disconnected') {
55 is_disconnected?59 is_disconnected?
56 } 60 }
57 end61 end
5862
=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb'
--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb 2012-04-18 03:38:17 +0000
+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/common.rb 2012-04-18 03:38:17 +0000
@@ -17,6 +17,16 @@
17 */17 */
18=end18=end
1919
20def wait_for_information
21 begin
22 @controlpanel.wait_child({:type=>'LoadingOverlay'}, 3)
23 verify_not(30, 'Information not loaded') {
24 @controlpanel.LoadingOverlay(:visible=>'true')
25 }
26 rescue MobyBase::SyncTimeoutError
27 end
28end
29
20def click_yes_on_dialog_button30def click_yes_on_dialog_button
21 @controlpanel.QDialogButtonBox(:name=>'qt_msgbox_buttonbox').QPushButton(:text=>'&Yes').tap31 @controlpanel.QDialogButtonBox(:name=>'qt_msgbox_buttonbox').QPushButton(:text=>'&Yes').tap
22end32end
2333
=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb'
--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb 2012-04-18 03:38:17 +0000
+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/controlpanel.rb 2012-04-18 03:38:17 +0000
@@ -17,6 +17,8 @@
17 */17 */
18=end18=end
1919
20require $actions_path + '/common.rb'
21
20def is_control_panel_visible?22def is_control_panel_visible?
21 return @controlpanel.QWidget(:name=>'management'). \23 return @controlpanel.QWidget(:name=>'management'). \
22 attribute('visible') == 'true'24 attribute('visible') == 'true'
@@ -27,12 +29,6 @@
27 wait_for_tab_bar29 wait_for_tab_bar
28end30end
2931
30def wait_for_information
31 verify_not(30, 'Information not loaded') {
32 @controlpanel.LoadingOverlay(:name=>'Form')
33 }
34end
35
36def wait_for_tab_bar32def wait_for_tab_bar
37 verify_equal('true', 10, 'Tab bar not displayed') {33 verify_equal('true', 10, 'Tab bar not displayed') {
38 get_tab_bar.attribute('visible')34 get_tab_bar.attribute('visible')
3935
=== modified file 'ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb'
--- ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb 2012-04-18 03:38:17 +0000
+++ ubuntuone/client/qt/tests/testabilitydriver/shared/actions/wizard.rb 2012-04-18 03:38:17 +0000
@@ -17,6 +17,87 @@
17 */17 */
18=end18=end
1919
20require $actions_path + '/common.rb'
21
20def is_wizard_visible?22def is_wizard_visible?
21 return @controlpanel.UbuntuOneWizard.attribute('visible') == 'true'23 begin
24 @controlpanel.wait_child({:type=>'UbuntuOneWizard',
25 :visible=>'true'},
26 3)
27 return true
28 rescue MobyBase::SyncTimeoutError
29 return false
30 end
31end
32
33def login
34 if is_wizard_visible?
35 sign_me_in_with_my_existing_account
36 sync_the_cloud_to_your_computer
37 sync_your_computer_with_the_cloud
38 end
39end
40
41def sign_me_in_with_my_existing_account
42 verify_true {
43 is_wizard_on_sign_in_page?
44 }
45 click_login_button
46 # TODO SSO log in.
47 puts 'Log in. You have 30 seconds.'
48 verify_true(30) {
49 is_wizard_on_the_sync_cloud_to_computer_page?
50 }
51end
52
53def is_wizard_on_sign_in_page?
54 return @controlpanel.SignInPanel.attribute('visible') == 'true'
55end
56
57def click_login_button
58 get_login_button.tap
59end
60
61def get_login_button
62 return @controlpanel.QPushButton(:name=>'login_button')
63end
64
65def sync_the_cloud_to_your_computer
66 verify_true {
67 is_wizard_on_the_sync_cloud_to_computer_page?
68 }
69 wait_for_information
70 click_next_button
71end
72
73def is_wizard_on_the_sync_cloud_to_computer_page?
74 return @controlpanel.CloudToComputerPage.attribute('visible') == 'true'
75end
76
77def click_next_button
78 get_next_button.tap
79end
80
81def get_next_button
82 return @controlpanel.QPushButton(:name=>'__qt__passive_wizardbutton1')
83end
84
85def sync_your_computer_with_the_cloud
86 verify_true {
87 is_wizard_on_the_sync_computer_to_cloud_page?
88 }
89 wait_for_information
90 click_finish_button
91end
92
93def is_wizard_on_the_sync_computer_to_cloud_page?
94 return @controlpanel.ComputerToCloudPage.attribute('visible') == 'true'
95end
96
97def click_finish_button
98 get_finish_button.tap
99end
100
101def get_finish_button
102 return @controlpanel.QPushButton(:text=>'&Finish')
22end103end

Subscribers

People subscribed via source and target branches