Merge lp:~carla-sella/sudoku-app/hint_button_test into lp:sudoku-app

Proposed by Nicholas Skaggs
Status: Merged
Approved by: David Planella
Approved revision: 85
Merged at revision: 87
Proposed branch: lp:~carla-sella/sudoku-app/hint_button_test
Merge into: lp:sudoku-app
Diff against target: 130 lines (+78/-2) (has conflicts)
3 files modified
sudoku-app.qml (+3/-0)
tests/autopilot/sudoku_app/emulators/main_window.py (+19/-0)
tests/autopilot/sudoku_app/tests/test_sudoku.py (+56/-2)
Text conflict in tests/autopilot/sudoku_app/tests/test_sudoku.py
To merge this branch: bzr merge lp:~carla-sella/sudoku-app/hint_button_test
Reviewer Review Type Date Requested Status
Dinko Osmankovic Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Nicholas Skaggs Pending
Review via email: mp+175395@code.launchpad.net

This proposal supersedes a proposal from 2013-07-16.

Commit message

Fixed the test_hint_button test, it used to fail as the hint button on the toolbar was not enabled, and completed it too by clicking on the hints switch in settings tab to enable the hint button on the toolbar.

Description of the change

Fixed the test_hint_button test, it used to fail as the hint button on the toolbar was not enabled, and completed it too by clicking on the hints switch in settings tab to enable the hint button on the toolbar.

To post a comment you must log in.
Revision history for this message
Dinko Osmankovic (dinko-metalac) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote : Posted in a previous version of this proposal

Jenkins failed the merge because there is a small conflict because of the merge from Adrian this morning. Should be a really easy fix and merge.

review: Needs Fixing
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Dinko Osmankovic (dinko-metalac) :
review: Approve
Revision history for this message
Dinko Osmankovic (dinko-metalac) wrote :

After fixing the problem with merge I approved this since jenkins is failing with this.

Revision history for this message
David Planella (dpm) wrote :

Dinko: you need to top-approve it for Jenkins to be triggered, I've just done it for you.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sudoku-app.qml'
--- sudoku-app.qml 2013-07-17 14:35:52 +0000
+++ sudoku-app.qml 2013-07-17 20:18:27 +0000
@@ -533,6 +533,7 @@
533 }533 }
534534
535 ListItem.ValueSelector {535 ListItem.ValueSelector {
536 objectName: "difficultySelector"
536 id: difficultySelector537 id: difficultySelector
537 text: i18n.tr("Difficulty")538 text: i18n.tr("Difficulty")
538 values: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard")]539 values: [i18n.tr("Easy"), i18n.tr("Moderate"), i18n.tr("Hard"), i18n.tr("Ultra Hard")]
@@ -591,9 +592,11 @@
591 }592 }
592593
593 ListItem.Standard {594 ListItem.Standard {
595 objectName: "hintsSwitchClickable"
594 text: i18n.tr("Hints")596 text: i18n.tr("Hints")
595 width: parent.width597 width: parent.width
596 control: Switch {598 control: Switch {
599 objectName: "hintsSwitch"
597 id: disableHints600 id: disableHints
598 anchors.horizontalCenter: parent.horizontalCenter601 anchors.horizontalCenter: parent.horizontalCenter
599 anchors.verticalCenter: parent.verticalCenter602 anchors.verticalCenter: parent.verticalCenter
600603
=== modified file 'tests/autopilot/sudoku_app/emulators/main_window.py'
--- tests/autopilot/sudoku_app/emulators/main_window.py 2013-07-11 19:57:30 +0000
+++ tests/autopilot/sudoku_app/emulators/main_window.py 2013-07-17 20:18:27 +0000
@@ -32,3 +32,22 @@
3232
33 def get_number_dialog(self):33 def get_number_dialog(self):
34 return self.app.select_single("Dialog", objectName="picknumberscreen")34 return self.app.select_single("Dialog", objectName="picknumberscreen")
35
36 def get_hints_switch(self):
37 return self.app.select_single("CheckBox", objectName="hintsSwitch")
38
39 #clicking on this works instead on the previous one (get_hints_switch) it doesn't(but the previous
40 #has the clicked property so I am using both
41 def get_hints_switchClickable(self):
42 return self.app.select_single("Standard", objectName="hintsSwitchClickable")
43
44 def get_difficulty_selector(self):
45 return self.app.select_single("ValueSelector", objectName="difficultySelector")
46
47 def get_difficulty_selector_labelvisual(self):
48 labelvisual = self.get_difficulty_selector()
49 labelvisualList = labelvisual.select_many("LabelVisual", text="Easy")
50 return labelvisualList
51
52
53
3554
=== modified file 'tests/autopilot/sudoku_app/tests/test_sudoku.py'
--- tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-16 16:50:40 +0000
+++ tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-17 20:18:27 +0000
@@ -86,8 +86,8 @@
8686
87 #check label again87 #check label again
88 self.assertThat(label, Eventually(Equals("<b>Best scores for all players</b>")))88 self.assertThat(label, Eventually(Equals("<b>Best scores for all players</b>")))
89 89
90 def test_enter_and_cancel(self):90 def test_enter_and_cancel(self):
91 #find the first button that has a blank value91 #find the first button that has a blank value
92 gridButtons = self.main_window.get_blank_inputs()92 gridButtons = self.main_window.get_blank_inputs()
93 gridButton = gridButtons[0]93 gridButton = gridButtons[0]
@@ -127,6 +127,7 @@
127127
128 #check the value to ensure it worked128 #check the value to ensure it worked
129 self.assertThat(buttonValue, Eventually(Equals("4")))129 self.assertThat(buttonValue, Eventually(Equals("4")))
130<<<<<<< TREE
130 131
131 def test_new_game_button(self):132 def test_new_game_button(self):
132 self.ubuntusdk.click_toolbar_button("newgamebutton")133 self.ubuntusdk.click_toolbar_button("newgamebutton")
@@ -186,3 +187,56 @@
186187
187 188
188 189
190=======
191
192 def test_new_game_button(self):
193 self.ubuntusdk.click_toolbar_button("newgamebutton")
194
195 number_of_hints = lambda: self.app.select_single(objectName="blockgrid").numberOfHints
196 number_of_actions = lambda: self.app.select_single(objectName="blockgrid").numberOfActions
197 game_seconds = lambda: self.app.select_single(objectName="blockgrid").gameSeconds
198
199 self.assertThat(number_of_hints, Eventually(Equals(0)))
200 self.assertThat(number_of_actions, Eventually(Equals(0)))
201 self.assertThat(game_seconds, Eventually(Equals(0)))
202
203 def test_hint_button(self):
204 #open settings tab
205 self.open_and_check_settings_tab()
206
207 #click on hints switch to enalbe hints toolbar button
208 hintsSwitchClickable = self.main_window.get_hints_switchClickable()
209 lambda: self.assertThat(hintsSwitchClickable.text, Eventually(Equals("Hints")))
210
211 #turn on (by clicking on it) hints switch if not already
212 hintsSwitch = self.main_window.get_hints_switch()
213 lambda: self.assertThat(hintsSwitch.id, Eventually(Equals("disableHints")))
214 if hintsSwitch.checked == False:
215 self.pointing_device.click_object(hintsSwitchClickable)
216
217 #verify hints switch is clicked
218 self.assertThat(hintsSwitch.checked, Eventually(Equals(True)))
219
220 # exit settings tab by clicking on sudoku tab
221 self.ubuntusdk.switch_to_tab(0)
222
223 #verify settings sudoku tab is open
224 tabName = lambda: self.ubuntusdk.get_object("Tab","Sudoku")
225 #self.assertThat(tabName, Eventually(NotEquals(None)))
226
227 #click on hint button on tuolbar
228 self.ubuntusdk.click_toolbar_button("hintbutton")
229 gridButtons = self.main_window.get_blank_inputs()
230
231 number_of_hints = lambda: self.app.select_single(objectName="blockgrid").numberOfHints
232 self.assertThat(number_of_hints, Eventually(Equals(1)))
233
234 def open_and_check_settings_tab(self):
235 #click on settings tab so to enable the hints button
236 self.ubuntusdk.switch_to_tab(2)
237
238 #verify settings tab is open
239 tabName = lambda: self.ubuntusdk.get_object("Tab","settingsTab")
240 self.assertThat(tabName, Eventually(NotEquals(None)))
241
242>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches