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
1=== modified file 'sudoku-app.qml'
2--- sudoku-app.qml 2013-07-15 09:22:56 +0000
3+++ sudoku-app.qml 2013-07-16 16:59:38 +0000
4@@ -689,6 +689,7 @@
5 anchors.horizontalCenter: parent.horizontalCenter;
6 y: units.gu(8);
7 Image {
8+ objectName: "aboutImage"
9 property real maxWidth: units.gu(100)
10 anchors.horizontalCenter: parent.horizontalCenter
11 width: Math.min(mainView.width, maxWidth)/1.75
12@@ -702,28 +703,33 @@
13 //anchors.horizontalCenter: parent.horizontalCenter;
14 anchors.left: aboutColumn.left
15 Label {
16+ objectName: "authorLabel"
17 text: i18n.tr("Author(s): ")
18
19 }
20 Label {
21+ objectName: "authors"
22+ font.bold: true;
23+ text: "Dinko Osmankovic\nFr\u00e9d\u00e9ric Delgado\nGeorgi Karavasilev"
24+ }
25+ }
26+ Row {
27+ anchors.horizontalCenter: parent.horizontalCenter;
28+ Label {
29+ objectName: "contactLabel"
30+ text: i18n.tr("Contact: ")
31+ }
32+ Label {
33+ objectName: "contacts"
34 font.bold: true;
35 text: "Dinko Osmankovic\nFrédéric Delgado\nGeorgi Karavasilev"
36 }
37 }
38 Row {
39- anchors.horizontalCenter: parent.horizontalCenter;
40- Label {
41- text: i18n.tr("Contact: ")
42- }
43- Label {
44- font.bold: true;
45- text: "dinko.metalac@gmail.com\nfredoust@gmail.com\nmotoroslav@gmail.com"
46- }
47- }
48- Row {
49 id: homepage;
50 anchors.horizontalCenter: parent.horizontalCenter;
51 Label {
52+ objectName: "urlLabel"
53 font.bold: true;
54 text: "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>"
55 onLinkActivated: Qt.openUrlExternally(link)
56@@ -735,9 +741,11 @@
57 anchors.top: aboutColumn.bottom;
58 anchors.topMargin: units.gu(5);
59 Label {
60+ objectName: "versionLabel"
61 text: i18n.tr("Version: ")
62 }
63 Label {
64+ objectName: "version"
65 font.bold: true;
66 text: "0.4"
67 }
68@@ -747,6 +755,7 @@
69 anchors.top: aboutColumn.bottom;
70 anchors.topMargin: units.gu(8);
71 Label {
72+ objectName: "yearLabel"
73 font.bold: true;
74 text: "2013"
75 }
76
77=== modified file 'tests/autopilot/sudoku_app/tests/test_sudoku.py'
78--- tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-12 10:12:39 +0000
79+++ tests/autopilot/sudoku_app/tests/test_sudoku.py 2013-07-16 16:59:38 +0000
80@@ -145,8 +145,44 @@
81
82 number_of_hints = lambda: self.app.select_single(objectName="blockgrid").numberOfHints
83 self.assertThat(number_of_hints, Eventually(Equals(1)))
84-
85-
86-
87-
88+
89+ def test_about_tab(self):
90+ #Switch to the 'About' tab
91+ self.ubuntusdk.switch_to_tab(3)
92+
93+ #Check for'About' tab selection
94+ tabName = lambda: self.ubuntusdk.get_object("Tab", "aboutTab")
95+ self.assertThat(tabName, Eventually(NotEquals(None)))
96+
97+ #Check image loads
98+ aboutImage = lambda: self.ubuntusdk.get_object("QQuickImage", "aboutImage").progress
99+ self.assertThat(aboutImage, Eventually(Equals(1.0)))
100+
101+ #Check the 'Author(s):' label is displayed
102+ aboutLabel = lambda: self.ubuntusdk.get_object("Label", "authorLabel").text
103+ self.assertThat(aboutLabel, Eventually(Equals("Author(s): ")))
104+
105+ #Check the 'Contact:' label is displayed
106+ contactLabel = lambda: self.ubuntusdk.get_object("Label", "contactLabel").text
107+ self.assertThat(contactLabel, Eventually(Equals("Contact: ")))
108+
109+ #Check correct Launchpad URL: is displayed
110+ urlLabel = lambda: self.ubuntusdk.get_object("Label", "urlLabel").text
111+ self.assertThat(urlLabel, Eventually(Equals(
112+ "<a href=\"https://launchpad.net/sudoku-app\">https://launchpad.net/sudoku-app</a>")))
113+
114+ #Check the 'Version:' label is displayed
115+ versionLabel = lambda: self.ubuntusdk.get_object("Label", "versionLabel").text
116+ self.assertThat(versionLabel, Eventually(Equals("Version: ")))
117+
118+ #Check correct version is displayed
119+ version = lambda: self.ubuntusdk.get_object("Label", "version").text
120+ self.assertThat(version, Eventually(Equals("0.4")))
121+
122+ #Check correct year is displayed
123+ yearLabel = lambda: self.ubuntusdk.get_object("Label", "yearLabel").text
124+ self.assertThat(yearLabel, Eventually(Equals("2013")))
125+
126+
127+
128

Subscribers

People subscribed via source and target branches