on xenial help sign in
adding test
20f4803Diego Sarmentero
qml/Dash/Previews/PreviewPayments.qml+1
@@ -65,6 +65,7 @@ PreviewWidget {
65
65
66 ProgressBar {
66 ProgressBar {
67 id: loadingBar
67 id: loadingBar
68+ objectName: "loadingBar"
68 indeterminate: true
69 indeterminate: true
69 anchors.fill: paymentButton
70 anchors.fill: paymentButton
70 opacity: 1 - paymentsButton.opacity
71 opacity: 1 - paymentsButton.opacity
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+19
@@ -66,6 +66,25 @@ Rectangle {
66 // Exercise the purchaseCompleted signal here.
66 // Exercise the purchaseCompleted signal here.
67 previewPayments.widgetData = jsonPurchase;
67 previewPayments.widgetData = jsonPurchase;
68
68
69+ var button = findChild(root, "paymentButton");
70+ verify(button != null, "Button not found.");
71+ var progress = findChild(root, "loadingBar");
72+ verify(progress != null, "ProgressBar not found.");
73+
74+ mouseClick(button, button.width / 2, button.height / 2);
75+
76+ spy.wait();
77+
78+ verify(progress.visible == true, "ProgressBar not visible.");
79+ verify(progress.opacity == 1, "ProgressBar wrong opacity.");
80+ verify(button.visible == false, "Button visible.");
81+ verify(button.opacity == 0, "Button wrong opacity.");
82+ }
83+
84+ function test_progress_show() {
85+ // Make sure the progress bar is shown.
86+ previewPayments.widgetData = jsonPurchase;
87+
69 var button = findChild(root, "paymentButton");
88 var button = findChild(root, "paymentButton");
70 verify(button != null, "Button not found.");
89 verify(button != null, "Button not found.");
71
90