Merge lp:~chocanto/ubuntu-docviewer-app/autopilot-testCases into lp:ubuntu-docviewer-app/trunk

Proposed by Anthony Granger
Status: Merged
Approved by: Anthony Granger
Approved revision: 17
Merged at revision: 13
Proposed branch: lp:~chocanto/ubuntu-docviewer-app/autopilot-testCases
Merge into: lp:ubuntu-docviewer-app/trunk
Prerequisite: lp:~chocanto/ubuntu-docviewer-app/autopilot-tests
Diff against target: 138 lines (+66/-16)
4 files modified
ImageView.qml (+1/-0)
TextView.qml (+10/-9)
tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py (+54/-7)
ubuntu-docviewer-app.qml (+1/-0)
To merge this branch: bzr merge lp:~chocanto/ubuntu-docviewer-app/autopilot-testCases
Reviewer Review Type Date Requested Status
Anthony Granger Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+172177@code.launchpad.net

Commit message

A simple testcase to check if docviewer can open a plain text file.

Description of the change

A simple testcase to check if docviewer can open a plain text file.

To post a comment you must log in.
16. By Anthony Granger

Added a testcase to read mimetype of a text file

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
17. By Anthony Granger

Add testcases for opening an image and read image meta-data

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Anthony Granger (chocanto) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ImageView.qml'
--- ImageView.qml 2013-04-25 16:43:54 +0000
+++ ImageView.qml 2013-06-30 15:13:26 +0000
@@ -9,6 +9,7 @@
99
10 Image{10 Image{
11 id: image11 id: image
12 objectName: "imageItem"
1213
13 source: file.getPath()14 source: file.getPath()
14 smooth: true15 smooth: true
1516
=== modified file 'TextView.qml'
--- TextView.qml 2013-04-25 16:33:39 +0000
+++ TextView.qml 2013-06-30 15:13:26 +0000
@@ -10,21 +10,22 @@
1010
1111
12 Column {12 Column {
13 id: columnMain;13 id: columnMain
14 width: parent.width;14 objectName: "columnMain"
15 width: parent.width
15 spacing: 1016 spacing: 10
1617
17 TextArea {18 TextArea {
1819 id: textAreaMain
19 id: textAreaMain;20 objectName: "textAreaMain"
2021
21 width: parent.width;22 width: parent.width
2223
23 autoSize: true;24 autoSize: true
24 maximumLineCount: 025 maximumLineCount: 0
25 readOnly: true26 readOnly: true
26 //activeFocusOnPress: false;27 //activeFocusOnPress: false;
27 highlighted: true;28 highlighted: true
2829
29 text: "Loading..."30 text: "Loading..."
3031
3132
=== added file 'tests/autopilot/ubuntu_docviewer_app/files/ubuntu-touch.jpg'
32Binary files tests/autopilot/ubuntu_docviewer_app/files/ubuntu-touch.jpg 1970-01-01 00:00:00 +0000 and tests/autopilot/ubuntu_docviewer_app/files/ubuntu-touch.jpg 2013-06-30 15:13:26 +0000 differ33Binary files tests/autopilot/ubuntu_docviewer_app/files/ubuntu-touch.jpg 1970-01-01 00:00:00 +0000 and tests/autopilot/ubuntu_docviewer_app/files/ubuntu-touch.jpg 2013-06-30 15:13:26 +0000 differ
=== modified file 'tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py'
--- tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2013-06-30 15:13:26 +0000
+++ tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2013-06-30 15:13:26 +0000
@@ -9,8 +9,10 @@
99
10from __future__ import absolute_import10from __future__ import absolute_import
1111
12from pprint import pprint
13
12from autopilot.matchers import Eventually14from autopilot.matchers import Eventually
13from testtools.matchers import Equals15from testtools.matchers import Equals, NotEquals
1416
15from ubuntu_docviewer_app.tests import DocviewerTestCase17from ubuntu_docviewer_app.tests import DocviewerTestCase
1618
@@ -29,9 +31,54 @@
2931
30 self.launch_test_local(filePath)32 self.launch_test_local(filePath)
31 33
32 self.assertThat(34 #Check if the app is correclty launched
33 self.ubuntusdk.get_qml_view().visible, Eventually(Equals(True)))35 self.assertThat(
3436 self.ubuntusdk.get_qml_view().visible, Eventually(Equals(True)))
35 #verify textbox is no longer empty37
36 # or38 textArea = self.ubuntusdk.get_object("TextArea", "textAreaMain")
37 #verify the file size displayed is not 0 (maybe easier ?)39
40 #Check if textarea is no longer empty
41 self.assertThat(
42 textArea.text, Eventually(NotEquals(False)))
43
44 def test_read_text_file_mimeType(self):
45 filePath = 'ubuntu_docviewer_app/files/plaintext.txt'
46
47 self.launch_test_local(filePath)
48
49 self.check_mimeType()
50
51 def test_open_image_file(self):
52
53 filePath = 'ubuntu_docviewer_app/files/ubuntu-touch.jpg'
54
55 self.launch_test_local(filePath)
56
57 #Check if the app is correclty launched
58 self.assertThat(
59 self.ubuntusdk.get_qml_view().visible, Eventually(Equals(True)))
60
61 imageItem = self.ubuntusdk.get_object("QQuickImage", "imageItem")
62
63 #Check if status of Image is "Ready"
64 self.assertThat(
65 imageItem.status, Eventually(Equals(1)))
66
67 def test_read_image_file_mimeType(self):
68 filePath = 'ubuntu_docviewer_app/files/ubuntu-touch.jpg'
69
70 self.launch_test_local(filePath)
71 self.check_mimeType()
72
73
74 def check_mimeType(self):
75 mimetypeItem = self.ubuntusdk.get_object("SingleValue", "mimetypeItem")
76
77 self.assertThat(
78 mimetypeItem.value, Eventually(NotEquals(False)))
79
80
81
82
83
84
3885
=== modified file 'ubuntu-docviewer-app.qml'
--- ubuntu-docviewer-app.qml 2013-04-25 16:33:39 +0000
+++ ubuntu-docviewer-app.qml 2013-06-30 15:13:26 +0000
@@ -69,6 +69,7 @@
6969
70 ListItem.SingleValue {70 ListItem.SingleValue {
71 id: mimetypeItem71 id: mimetypeItem
72 objectName: "mimetypeItem"
72 text: i18n.tr("Mimetype")73 text: i18n.tr("Mimetype")
73 value: file.getMimetype()74 value: file.getMimetype()
74 }75 }

Subscribers

People subscribed via source and target branches