on xenial help sign in
modified the unlock() test for the HW keyboard case
commitf500c2f6cc436429302bae03ffdafb41e3b5ab81 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 26 Feb 2016, 17:28 (11 years ago) parentb9c963d
1 file changed+14−7
tests/qmltests/Components/tst_Lockscreen.qml+14−7
tests/qmltests/Components/tst_Lockscreen.qml+14−7
@@ -235,11 +235,14 @@ Rectangle {
235235
236236 function test_unlock_data() {
237237 return [
238− {tag: "numeric", alphanumeric: false, password: "1234", minPinLength: 4, maxPinLength: 4},
239− {tag: "alphanumeric", alphanumeric: true, password: "password", minPinLength: -1, maxPinLength: -1},
240− {tag: "numeric (wrong)", alphanumeric: false, password: "4321", minPinLength: 4, maxPinLength: 4},
241− {tag: "alphanumeric (wrong)", alphanumeric: true, password: "drowssap", minPinLength: -1, maxPinLength: -1},
242− {tag: "flexible length", alphanumeric: false, password: "1234", minPinLength: -1, maxPinLength: -1},
238+ {tag: "numeric", alphanumeric: false, password: "1234", minPinLength: 4, maxPinLength: 4, keyboard: false},
239+ {tag: "alphanumeric", alphanumeric: true, password: "password", minPinLength: -1, maxPinLength: -1, keyboard: false},
240+ {tag: "numeric (wrong)", alphanumeric: false, password: "4321", minPinLength: 4, maxPinLength: 4, keyboard: false},
241+ {tag: "alphanumeric (wrong)", alphanumeric: true, password: "drowssap", minPinLength: -1, maxPinLength: -1, keyboard: false},
242+ {tag: "flexible length", alphanumeric: false, password: "1234", minPinLength: -1, maxPinLength: -1, keyboard: false},
243+ {tag: "numeric", alphanumeric: false, password: "1234", minPinLength: 4, maxPinLength: 4, keyboard: true},
244+ {tag: "numeric (wrong)", alphanumeric: false, password: "4321", minPinLength: 4, maxPinLength: 4, keyboard: true},
245+ {tag: "flexible length", alphanumeric: false, password: "1234", minPinLength: -1, maxPinLength: -1, keyboard: true}
243246 ]
244247 }
245248
@@ -259,8 +262,12 @@ Rectangle {
259262 } else {
260263 for (var i = 0; i < data.password.length; ++i) {
261264 var character = data.password.charAt(i)
262− var button = findChild(lockscreen, "pinPadButton" + character)
263− mouseClick(button, units.gu(1), units.gu(1))
265+ if (data.keyboard) {
266+ typeString(character)
267+ } else {
268+ var button = findChild(lockscreen, "pinPadButton" + character)
269+ mouseClick(button, units.gu(1), units.gu(1))
270+ }
264271 }
265272 var confirmButton = findChild(lockscreen, "confirmButton");
266273 mouseClick(confirmButton, units.gu(1), units.gu(1));