This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui-test-_misc.js
115 lines (77 loc) · 2.85 KB
/
ui-test-_misc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift();
describe('OLSKPasscode_Misc', function () {
before(function() {
return browser.OLSKVisit(kDefaultRoute);
});
before(function () {
return browser.pressButton('#TestOLSKModalViewShow');
});
describe('OLSKPasscode', function test_OLSKPasscode () {
it('classes OLSKDecor', function () {
browser.assert.hasClass(OLSKPasscode, 'OLSKDecor');
});
});
describe('OLSKPasscodePasswordField1', function test_OLSKPasscodePasswordField1 () {
it('sets type', function () {
browser.assert.attribute(OLSKPasscodePasswordField1, 'type', 'password');
});
});
describe('OLSKPasscodePasswordField2', function test_OLSKPasscodePasswordField2 () {
it('sets type', function () {
browser.assert.attribute(OLSKPasscodePasswordField2, 'type', 'password');
});
});
describe('OLSKPasscodeFutileField', function test_OLSKPasscodeFutileField () {
it('sets type', function () {
browser.assert.attribute(OLSKPasscodeFutileField, 'type', 'checkbox');
});
});
describe('OLSKPasscodeContinueButton', function test_OLSKPasscodeContinueButton () {
it('sets disabled', function () {
browser.assert.attribute(OLSKPasscodeContinueButton, 'disabled', '');
});
context('filled', function () {
const item = Math.random().toString();
before(function () {
return browser.fill(OLSKPasscodePasswordField1, item);
});
before(function () {
return browser.fill(OLSKPasscodePasswordField2, item);
});
before(function () {
return browser.check(OLSKPasscodeFutileField);
});
it('sets disabled', function () {
browser.assert.attribute(OLSKPasscodeContinueButton, 'disabled', null);
});
context('click', function () {
before(function () {
browser.assert.text('#TestOLSKPasscodeDispatchContinue', '0');
});
before(function () {
return browser.pressButton(OLSKPasscodeContinueButton);
});
it('sends OLSKPasscodeDispatchContinue', function () {
browser.assert.text('#TestOLSKPasscodeDispatchContinue', '1');
});
it('sets OLSK_PASSCODE_HASH', async function () {
browser.assert.evaluate('localStorage.getItem("OLSK_PASSCODE_HASH")', require('OLSKCrypto').OLSKCryptoPBKDF2Hash(await require('OLSKCrypto').OLSKCryptoPBKDF2Key(item)));
});
});
context('re-open', function () {
before(function () {
return browser.pressButton('#TestOLSKModalViewShow');
});
it('clears OLSKPasscodePasswordField1', function () {
browser.assert.input(OLSKPasscodePasswordField1, '');
});
it('clears OLSKPasscodePasswordField2', function () {
browser.assert.input(OLSKPasscodePasswordField2, '');
});
it('clears OLSKPasscodeFutileField', function () {
browser.assert.OLSKIsChecked(OLSKPasscodeFutileField, false);
});
});
});
});
});