on xenial help sign in
adding comments on compare
commit6ea67a2da2302e25dcc2322e21ad811e4991fae3 authorDiego Sarmentero <diego.sarmentero@gmail.com> dateTue 23 Jul 2013, 10:28 (13 years ago) parent8ca8eb8
3 files changed+14−14
tests/qmltests/Dash/Apps/tst_AppInfo.qml+2−2 tests/qmltests/Dash/Apps/tst_AppPreview.qml+2−2 tests/qmltests/Dash/Apps/tst_AppReviews.qml+10−10
tests/qmltests/Dash/Apps/tst_AppInfo.qml+2−2
@@ -41,12 +41,12 @@ Item {
4141
4242 function test_rated() {
4343 var rated = findChild(appInfo, "ratedLabel");
44− compare(rated.text, "(120)");
44+ compare(rated.text, "(120)", "Rates not equal");
4545 }
4646
4747 function test_reviews() {
4848 var rated = findChild(appInfo, "reviewsLabel");
49− compare(rated.text, i18n.tr("%n review", "%n reviews", 8));
49+ compare(rated.text, i18n.tr("%n review", "%n reviews", 8), "Reviews don't match");
5050 }
5151 }
5252}
tests/qmltests/Dash/Apps/tst_AppPreview.qml+2−2
@@ -108,7 +108,7 @@ Item {
108108 function test_actions() {
109109 root.calls = new Array();
110110 var buttons = findChild(appPreview, "gridButtons");
111− compare(buttons.count, 3);
111+ compare(buttons.count, 3, "Not the proper amount of actions detected.");
112112
113113 for(var i = 0; i < buttons.count; i++) {
114114 buttons.currentIndex = i;
@@ -117,7 +117,7 @@ Item {
117117
118118 var actions = get_actions();
119119 for(var i = 0; i < actions.length; i++) {
120− compare(root.calls[i], actions[i].id);
120+ compare(root.calls[i], actions[i].id, "Id of action not found.");
121121 }
122122 }
123123 }
tests/qmltests/Dash/Apps/tst_AppReviews.qml+10−10
@@ -76,8 +76,8 @@ Item {
7676 appReviews.state = "";
7777 var reviewField = findChild(appReviews, "reviewField");
7878 var sendButton = findChild(appReviews, "sendButton");
79− compare(reviewField.width, appReviews.width);
80− compare(sendButton.opacity, 0);
79+ compare(reviewField.width, appReviews.width, "ReviewField width don't match");
80+ compare(sendButton.opacity, 0, "SendButton opacity should be 0");
8181 }
8282
8383 function test_send_review() {
@@ -92,11 +92,11 @@ Item {
9292 var sendButton = findChild(appReviews, "sendButton");
9393 var reviewField = findChild(appReviews, "reviewField");
9494
95− compare(reviewField.focus, false);
96− compare(appReviews.state, "");
95+ compare(reviewField.focus, false, "ReviewField shouldn't have focus");
96+ compare(appReviews.state, "", "State should be empty");
9797 mouseClick(reviewField, 1, 1);
98− compare(reviewField.focus, true);
99− compare(appReviews.state, "editing");
98+ compare(reviewField.focus, true, "Review Field should have focus");
99+ compare(appReviews.state, "editing", "State should be 'editing'");
100100 }
101101
102102 function test_comments() {
@@ -107,10 +107,10 @@ Item {
107107 var rate = commentsArea.itemAt(i).children[0].children[1].children[0].rating
108108 var date = commentsArea.itemAt(i).children[0].children[1].children[1].text
109109 var comment = commentsArea.itemAt(i).children[1].text
110− compare(username, root._username);
111− compare(rate, root._rating);
112− compare(date, root._date);
113− compare(comment, root._comment);
110+ compare(username, root._username, "Username don't match");
111+ compare(rate, root._rating, "Rating don't match");
112+ compare(date, root._date, "Date don't match");
113+ compare(comment, root._comment, "Comment don't match");
114114 }
115115 }
116116