@@ -42,6 +42,7 @@ Item {
42 QtObject { id: rated; property int value: 120 }
42 QtObject { id: rated; property int value: 120 }
43 QtObject { id: reviews; property int value: 8 }
43 QtObject { id: reviews; property int value: 8 }
44 QtObject { id: progress; property string value: "source" }
44 QtObject { id: progress; property string value: "source" }
45+ QtObject { id: publisher; property string value: "Ubuntu Developer" }
45 QtObject { id: comments; property var value: [
46 QtObject { id: comments; property var value: [
46 ["Unity User", 4, "08/20/2013", root.commentary],
47 ["Unity User", 4, "08/20/2013", root.commentary],
47 ["Unity User", 8, "01/15/2013", root.commentary],
48 ["Unity User", 8, "01/15/2013", root.commentary],
@@ -62,7 +63,8 @@ Item {
62 property var infoMap: {
63 property var infoMap: {
63 "more-screenshots": screenshots,
64 "more-screenshots": screenshots,
64 "rated": rated,
65 "rated": rated,
65− "comments": comments
66+ "comments": comments,
67+ "publisher": publisher
67 property var actions: [
69 property var actions: [
68 { "id": 123, "displayName": "action1" },
70 { "id": 123, "displayName": "action1" },
@@ -84,6 +86,7 @@ Item {
84 "more-screenshots": screenshots,
86 "more-screenshots": screenshots,
85 "rated": rated,
87 "rated": rated,
86 "comments": comments,
88 "comments": comments,
89+ "publisher": publisher,
87 "progressbar_source": progressSource
90 "progressbar_source": progressSource
89 property var actions: [
92 property var actions: [
@@ -112,14 +115,15 @@ Item {
112 function cleanup() {
115 function cleanup() {
113 root.calls = new Array();
116 root.calls = new Array();
114 sendPreviewSpy.clear();
117 sendPreviewSpy.clear();
118+ // TODO: This doesn't work right now as Reviews are disabled
115− var reviewField = findChild(appPreview, "reviewField");
119+ //var reviewField = findChild(appPreview, "reviewField");
116− reviewField.focus = false;
120+ //reviewField.focus = false;
117− reviewField.text = "";
121+ //reviewField.text = "";
118− data.rating = rating.value;
122+ //data.rating = rating.value;
119 dataProgress.infoMap["progressbar_source"].value = "service";
123 dataProgress.infoMap["progressbar_source"].value = "service";
120− var appReviews = findChild(appPreview, "appReviews");
124+ //var appReviews = findChild(appPreview, "appReviews");
121− appReviews.visible = false;
125+ //appReviews.visible = false;
122− appPreview.keyboardSize = 0;
126+ //appPreview.keyboardSize = 0;
125 function test_actions() {
129 function test_actions() {
@@ -137,6 +141,14 @@ Item {
144+ function test_check_app_info() {
145+ var appInfo = findChild(appPreview, "previewHeader");
146+ var titleLabel = findChild(appInfo, "titleLabel");
147+ var subtitleLabel = findChild(appInfo, "subtitleLabel");
148+ compare(titleLabel.text, data.title, "App Title doesn't match.");
149+ compare(subtitleLabel.text, publisher.value, "Publisher name doesn't match.");
140 function test_rated() {
152 function test_rated() {
141 var rated = findChild(appPreview, "ratedLabel");
153 var rated = findChild(appPreview, "ratedLabel");
142 compare(rated.text, "(120)", "Rates not equal");
154 compare(rated.text, "(120)", "Rates not equal");
@@ -147,13 +159,16 @@ Item {
147 compare(rated.text, "8 reviews", "Reviews don't match");
159 compare(rated.text, "8 reviews", "Reviews don't match");
162+ // TODO: Disabled as reviewing and commenting is currently disabled
150− function test_send_review() {
163+/* function test_send_review() {
151 var appReviews = findChild(appPreview, "appReviews");
164 var appReviews = findChild(appPreview, "appReviews");
152 appReviews.sendReview("review");
165 appReviews.sendReview("review");
153 sendPreviewSpy.wait();
166 sendPreviewSpy.wait();
156 function test_review_focus() {
169 function test_review_focus() {
170+ var columnReviewRating = findChild(appPreview, "columnReviewRating");
171+ columnReviewRating.visible = true;
157 var appReviews = findChild(appPreview, "appReviews");
172 var appReviews = findChild(appPreview, "appReviews");
158 appReviews.visible = true;
173 appReviews.visible = true;
159 var sendButton = findChild(appReviews, "sendButton");
174 var sendButton = findChild(appReviews, "sendButton");
@@ -194,6 +209,22 @@ Item {
194 verify(buttons.visible == true);
209 verify(buttons.visible == true);
212+ function test_automatic_scroll_on_keyboard_shown() {
213+ waitForRendering(appPreview);
214+ var appReviews = findChild(appPreview, "appReviews");
215+ appReviews.visible = true;
217+ var leftFlickable = findChild(appPreview, "leftFlickable");
218+ leftFlickable.contentY = leftFlickable.contentHeight;
219+ var reviewField = findChild(appReviews, "reviewField");
220+ appPreview.keyboardSize = 400;
221+ appReviews.editing(reviewField);
222+ var newFlickPos = leftFlickable.contentY;
223+ var keyboardY = shell.height - appPreview.keyboardSize;
224+ verify(newFlickPos < keyboardY);
197 function test_progress_show() {
228 function test_progress_show() {
198 appPreview.previewData = dataProgress;
229 appPreview.previewData = dataProgress;
199 var progress = findChild(appPreview, "progressBar");
230 var progress = findChild(appPreview, "progressBar");
@@ -219,21 +250,5 @@ Item {
219 compare(root.calls[0][0], actions[1].id, "Id of action not found.");
250 compare(root.calls[0][0], actions[1].id, "Id of action not found.");
220 compare(root.calls[0][1], {"error": "DOWNLOAD ERROR"}, "Data of action not found.");
251 compare(root.calls[0][1], {"error": "DOWNLOAD ERROR"}, "Data of action not found.");
223− function test_automatic_scroll_on_keyboard_shown() {
224− waitForRendering(appPreview);
225− var appReviews = findChild(appPreview, "appReviews");
226− appReviews.visible = true;
228− var leftFlickable = findChild(appPreview, "leftFlickable");
229− leftFlickable.contentY = leftFlickable.contentHeight;
230− var reviewField = findChild(appReviews, "reviewField");
231− appPreview.keyboardSize = 400;
232− appReviews.editing(reviewField);
233− var newFlickPos = leftFlickable.contentY;
234− var keyboardY = shell.height - appPreview.keyboardSize;
235− verify(newFlickPos < keyboardY);