Merge lp:~canonical-platform-qa/ubiquity/update_failing_autopilot_tests into lp:ubiquity

Proposed by Christopher Lee
Status: Merged
Approved by: Jean-Baptiste Lallement
Approved revision: 6403
Merged at revision: 6411
Proposed branch: lp:~canonical-platform-qa/ubiquity/update_failing_autopilot_tests
Merge into: lp:ubiquity
Diff against target: 105 lines (+9/-53)
2 files modified
autopilot/ubiquity_autopilot_tests/configs/english_label_conf.py (+3/-2)
autopilot/ubiquity_autopilot_tests/tests/__init__.py (+6/-51)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubiquity/update_failing_autopilot_tests
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Ubuntu Installer Team Pending
Review via email: mp+290679@code.launchpad.net

Commit message

Update failing autopilot tests so they pass.

Description of the change

Update failing autopilot tests so they pass.

I updated the tests to work based on my understanding of how the code has changed.

- Removed unneeded checks as the prepare-page has changed
- Bumped up a timeout that was causing a sporadic failure on my machine (VM speeds being the issue)
- Update label text to match new text.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

The code looks reasonable to me. I'll try to verify the tests pass for me.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

This is working for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/ubiquity_autopilot_tests/configs/english_label_conf.py'
2--- autopilot/ubiquity_autopilot_tests/configs/english_label_conf.py 2015-09-15 17:55:47 +0000
3+++ autopilot/ubiquity_autopilot_tests/configs/english_label_conf.py 2016-04-01 04:15:29 +0000
4@@ -56,9 +56,10 @@
5 'The software is subject to license terms included with its ' \
6 'documentation.'.format(distro_flavor)
7 stepPrepare['prepare_download_updates'] = \
8- 'Download updates while installing'
9+ 'Download updates while installing {}'.format(distro_flavor)
10 stepPrepare['prepare_nonfree_software'] = \
11- 'Install this third-party software'
12+ 'Install third-party software for graphics and Wi-Fi hardware, ' \
13+ 'Flash, MP3 and other media'
14 stepPrepare['prepare_network_connection'] = \
15 'is connected to the Internet'
16 stepPrepare['prepare_sufficient_space'] = \
17
18=== modified file 'autopilot/ubiquity_autopilot_tests/tests/__init__.py'
19--- autopilot/ubiquity_autopilot_tests/tests/__init__.py 2015-09-05 12:56:03 +0000
20+++ autopilot/ubiquity_autopilot_tests/tests/__init__.py 2016-04-01 04:15:29 +0000
21@@ -252,8 +252,11 @@
22 preparing_page = self.main_window.select_single(
23 'GtkAlignment', BuilderName='stepPrepare')
24
25- objList = ['prepare_best_results', 'prepare_foss_disclaimer',
26- 'prepare_download_updates', 'prepare_nonfree_software']
27+ objList = [
28+ 'prepare_foss_disclaimer_license',
29+ 'prepare_download_updates',
30+ 'prepare_nonfree_software'
31+ ]
32 self.check_visible_object_with_label(objList)
33
34 if updates:
35@@ -268,15 +271,6 @@
36 'GtkCheckButton', BuilderName='prepare_nonfree_software')
37 self.pointing_device.click_object(thrdprty_checkbutton)
38
39- self._check_preparing_statebox('prepare_network_connection',
40- visible=networkConnection)
41- # and sufficient space
42- self._check_preparing_statebox('prepare_sufficient_space',
43- visible=sufficientSpace)
44- # and power source
45- self._check_preparing_statebox('prepare_power_source',
46- visible=powerSource)
47-
48 self._check_page_titles()
49 self._check_navigation_buttons()
50
51@@ -644,7 +638,7 @@
52 self._track_install_progress()
53 print("First loop complete waiting for pbar to go back to 0")
54 self.assertThat(progress_bar.fraction, Eventually(
55- Equals(0.0), timeout=180))
56+ Equals(0.0), timeout=260))
57 print("Now entering the second loop...........")
58 # And now the install progress bar
59 self._track_install_progress()
60@@ -1002,45 +996,6 @@
61 # "[Page:'{0}'] Expect page title to be visible "
62 # "but it wasn't".format(self.current_step))
63
64- def _check_preparing_statebox(self, stateboxName, visible=True,
65- imagestock='gtk-yes'):
66- """ Checks the preparing page statebox's """
67- logger.debug("Running checks on {0} StateBox".format(stateboxName))
68- preparing_page = self.main_window.select_single(
69- 'GtkAlignment', BuilderName='stepPrepare')
70- state_box = preparing_page.select_single(
71- 'StateBox', BuilderName=stateboxName)
72- logger.debug('check({0}, {1})'.format(visible, imagestock))
73- logger.debug("Running checks.......")
74- if visible:
75- self.expectThat(state_box.visible, Equals(visible),
76- "StateBox.check(): Expected {0} statebox to be "
77- "visible but it wasn't"
78- .format(state_box.name))
79- label = state_box.select_single('GtkLabel')
80- self.expectThat(label.label, NotEquals(u''),
81- "[Page:'{0}'] Expected {1} Statebox's label to "
82- "contain text but it didn't"
83- .format(self.current_step, stateboxName))
84- self.expectThat(label.visible, Equals(visible),
85- "[Page:'{0}'] Expected {1} Statebox label's "
86- "visible property to be {2} "
87- .format(self.current_step, stateboxName,
88- str(visible)))
89- self.expectIsInstance(label.label, str,
90- "[Page:'{0}'] Expected {1} Statebox's label "
91- "to be unicode but it wasn't"
92- .format(self.current_step, stateboxName))
93- image = state_box.select_single('GtkImage')
94- self.expectThat(image.stock, Equals(imagestock))
95- self.expectThat(image.visible, Equals(visible))
96-
97- else:
98- self.expectThat(state_box.visible, Equals(False),
99- "[Page:'{0}'] Expected {1} statebox to not be "
100- "visible but it was"
101- .format(self.current_step, stateboxName))
102-
103 def get_distribution(self, ):
104 """Returns the name of the running distribution."""
105 logger.debug("Detecting flavor")

Subscribers

People subscribed via source and target branches

to status/vote changes: