Merge lp:~adriangoodyer/sudoku-app/test_about_tab into lp:sudoku-app

Proposed by adriangoodyer
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 74
Merged at revision: 84
Proposed branch: lp:~adriangoodyer/sudoku-app/test_about_tab
Merge into: lp:sudoku-app
Diff against target: 127 lines (+59/-14)
2 files modified
sudoku-app.qml (+19/-10)
tests/autopilot/sudoku_app/tests/test_sudoku.py (+40/-4)
To merge this branch: bzr merge lp:~adriangoodyer/sudoku-app/test_about_tab
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Dinko Osmankovic Approve
Review via email: mp+175076@code.launchpad.net

Commit message

Completed test for the 'About' tab

Description of the change

Walkthrough:

- Switches to the 'About' tab
- Checks the tab is loaded
- Checks image loads correctly
- Checks all labels are present, with correct text
- Checks critical information is correct

To post a comment you must log in.
Revision history for this message
Dinko Osmankovic (dinko-metalac) :
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

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-15 09:22:56 +0000
+++ sudoku-app.qml 2013-07-16 16:59:38 +0000
@@ -689,6 +689,7 @@
689 anchors.horizontalCenter: parent.horizontalCenter;689 anchors.horizontalCenter: parent.horizontalCenter;
690 y: units.gu(8);690 y: units.gu(8);
691 Image {691 Image {
692 objectName: "aboutImage"
692 property real maxWidth: units.gu(100)693 property real maxWidth: units.gu(100)
693 anchors.horizontalCenter: parent.horizontalCenter694 anchors.horizontalCenter: parent.horizontalCenter
694 width: Math.min(mainView.width, maxWidth)/1.75695 width: Math.min(mainView.width, maxWidth)/1.75
@@ -702,28 +703,33 @@
702 //anchors.horizontalCenter: parent.horizontalCenter;703 //anchors.horizontalCenter: parent.horizontalCenter;
703 anchors.left: aboutColumn.left704 anchors.left: aboutColumn.left
704 Label {705 Label {
706 objectName: "authorLabel"
705 text: i18n.tr("Author(s): ")707 text: i18n.tr("Author(s): ")
706708
707 }709 }
708 Label {710 Label {
711 objectName: "authors"
712 font.bold: true;
713 text: "Dinko Osmankovic\nFr\u00e9d\u00e9ric Delgado\nGeorgi Karavasilev"
714 }
715 }
716 Row {
717 anchors.horizontalCenter: parent.horizontalCenter;
718 Label {
719 objectName: "contactLabel"
720 text: i18n.tr("Contact: ")
721 }
722 Label {
723 objectName: "contacts"
709 font.bold: true;724 font.bold: true;
710 text: "Dinko Osmankovic\nFrédéric Delgado\nGeorgi Karavasilev"725 text: "Dinko Osmankovic\nFrédéric Delgado\nGeorgi Karavasilev"
711 }726 }
712 }727 }
713 Row {728 Row {
714 anchors.horizontalCenter: parent.horizontalCenter;
715 Label {
716 text: i18n.tr("Contact: ")
717 }
718 Label {
719 font.bold: true;
720 text: "dinko.metalac@gmail.com\nfredoust@gmail.com\nmotoroslav@gmail.com"
721 }
722 }
723 Row {
724 id: homepage;729 id: homepage;
725 anchors.horizontalCenter: parent.horizontalCenter;730 anchors.horizontalCenter: parent.horizontalCenter;
726 Label {731 Label {
732 objectName: "urlLabel"
727 font.bold: true;733 font.bold: true;
728 text: "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>"734 text: "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>"
729 onLinkActivated: Qt.openUrlExternally(link)735 onLinkActivated: Qt.openUrlExternally(link)
@@ -735,9 +741,11 @@
735 anchors.top: aboutColumn.bottom;741 anchors.top: aboutColumn.bottom;
736 anchors.topMargin: units.gu(5);742 anchors.topMargin: units.gu(5);
737 Label {743 Label {
744 objectName: "versionLabel"
738 text: i18n.tr("Version: ")745 text: i18n.tr("Version: ")
739 }746 }
740 Label {747 Label {
748 objectName: "version"
741 font.bold: true;749 font.bold: true;
742 text: "0.4"750 text: "0.4"
743 }751 }
@@ -747,6 +755,7 @@
747 anchors.top: aboutColumn.bottom;755 anchors.top: aboutColumn.bottom;
748 anchors.topMargin: units.gu(8);756 anchors.topMargin: units.gu(8);
749 Label {757 Label {
758 objectName: "yearLabel"
750 font.bold: true;759 font.bold: true;
751 text: "2013"760 text: "2013"
752 }761 }
753762
=== modified file 'tests/autopilot/sudoku_app/tests/test_sudoku.py'
--- tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-12 10:12:39 +0000
+++ tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-16 16:59:38 +0000
@@ -145,8 +145,44 @@
145 145
146 number_of_hints = lambda: self.app.select_single(objectName="blockgrid").numberOfHints146 number_of_hints = lambda: self.app.select_single(objectName="blockgrid").numberOfHints
147 self.assertThat(number_of_hints, Eventually(Equals(1)))147 self.assertThat(number_of_hints, Eventually(Equals(1)))
148 148
149 149 def test_about_tab(self):
150150 #Switch to the 'About' tab
151 151 self.ubuntusdk.switch_to_tab(3)
152
153 #Check for'About' tab selection
154 tabName = lambda: self.ubuntusdk.get_object("Tab", "aboutTab")
155 self.assertThat(tabName, Eventually(NotEquals(None)))
156
157 #Check image loads
158 aboutImage = lambda: self.ubuntusdk.get_object("QQuickImage", "aboutImage").progress
159 self.assertThat(aboutImage, Eventually(Equals(1.0)))
160
161 #Check the 'Author(s):' label is displayed
162 aboutLabel = lambda: self.ubuntusdk.get_object("Label", "authorLabel").text
163 self.assertThat(aboutLabel, Eventually(Equals("Author(s): ")))
164
165 #Check the 'Contact:' label is displayed
166 contactLabel = lambda: self.ubuntusdk.get_object("Label", "contactLabel").text
167 self.assertThat(contactLabel, Eventually(Equals("Contact: ")))
168
169 #Check correct Launchpad URL: is displayed
170 urlLabel = lambda: self.ubuntusdk.get_object("Label", "urlLabel").text
171 self.assertThat(urlLabel, Eventually(Equals(
172 "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>")))
173
174 #Check the 'Version:' label is displayed
175 versionLabel = lambda: self.ubuntusdk.get_object("Label", "versionLabel").text
176 self.assertThat(versionLabel, Eventually(Equals("Version: ")))
177
178 #Check correct version is displayed
179 version = lambda: self.ubuntusdk.get_object("Label", "version").text
180 self.assertThat(version, Eventually(Equals("0.4")))
181
182 #Check correct year is displayed
183 yearLabel = lambda: self.ubuntusdk.get_object("Label", "yearLabel").text
184 self.assertThat(yearLabel, Eventually(Equals("2013")))
185
186
187
152 188

Subscribers

People subscribed via source and target branches