on xenial help sign in
add test for the new backspace button
962f4acMichael Zanetti
Greeter/PinLockscreen.qml+1
@@ -82,6 +82,7 @@ Column {
82
82
83 Icon {
83 Icon {
84 id: backspaceIcon
84 id: backspaceIcon
85+ objectName: "backspaceIcon"
85 anchors {
86 anchors {
86 top: parent.top
87 top: parent.top
87 topMargin: units.gu(1)
88 topMargin: units.gu(1)
tests/qmltests/Greeter/tst_Lockscreen.qml+31
@@ -215,5 +215,36 @@ Rectangle {
215 tryCompareFunction(function() {return inputField.text.length > 0}, true)
215 tryCompareFunction(function() {return inputField.text.length > 0}, true)
216 }
216 }
217 }
217 }
218+
219+ function test_backspace_data() {
220+ return [
221+ {tag: "fixed length", pinLength: 4},
222+ {tag: "variable length", pinLength: -1}
223+ ];
224+ }
225+
226+ function test_backspace(data) {
227+ LightDM.Greeter.authenticate("has-pin");
228+ pinLengthTextField.text = data.pinLength
229+ waitForRendering(lockscreen);
230+
231+ var pinPadButtonErase = findChild(lockscreen, "pinPadButtonErase");
232+ var backspaceIcon = findChild(lockscreen, "backspaceIcon");
233+ var pinEntryField = findChild(lockscreen, "pinentryField");
234+
235+ compare(pinPadButtonErase.iconName, data.pinLength == -1 ? "" : "erase");
236+ compare(backspaceIcon.visible, data.pinLength == -1);
237+
238+ var pinPadButton5 = findChild(lockscreen, "pinPadButton5");
239+ mouseClick(pinPadButton5, units.gu(1), units.gu(1));
240+ compare(pinEntryField.text, "5");
241+
242+ if (data.pinLength == -1) {
243+ mouseClick(backspaceIcon, units.gu(1), units.gu(1));
244+ } else {
245+ mouseClick(pinPadButtonErase, units.gu(1), units.gu(1));
246+ }
247+ compare(pinEntryField.text, "");
248+ }
218 }
249 }
219}
250}