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-_access.js
123 lines (86 loc) · 3.04 KB
/
ui-test-_access.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
116
117
118
119
120
121
122
123
const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift();
Object.entries({
OLSKPasscode: '.OLSKStandardViewBody .OLSKPasscode',
OLSKPasscodeBackupNotice: '.OLSKPasscodeBackupNotice',
OLSKPasscodePasswordField1: '.OLSKPasscodePasswordField1',
OLSKPasscodePasswordField2: '.OLSKPasscodePasswordField2',
OLSKPasscodeFutileFieldLabel: '.OLSKPasscodeFutileFieldLabel',
OLSKPasscodeFutileField: '.OLSKPasscodeFutileField',
OLSKPasscodeContinueButton: '.OLSKPasscodeContinueButton',
}).map(function (e) {
return global[e.shift()] = e.pop();
});
describe('OLSKPasscode_Access', function () {
before(function() {
return browser.OLSKVisit(kDefaultRoute);
});
it('hides OLSKPasscode', function () {
browser.assert.elements(OLSKPasscode, 0);
});
it('shows OLSKPasscodeLauncherFakeItemProxy', function () {
return browser.assert.OLSKLauncherItems('OLSKPasscodeLauncherFakeItemProxy', 1);
});
it('shows OLSKPasscodeLauncherItemConfigure', function () {
return browser.assert.OLSKLauncherItems('OLSKPasscodeLauncherItemConfigure', 1);
});
context('OLSKModalViewShow', function () {
before(function () {
return browser.pressButton('#TestOLSKModalViewShow');
});
it('shows OLSKPasscode', function () {
browser.assert.elements(OLSKPasscode, 1);
});
it('shows OLSKPasscodeBackupNotice', function () {
browser.assert.elements(OLSKPasscodeBackupNotice, 1);
});
it('shows OLSKPasscodePasswordField1', function () {
browser.assert.elements(OLSKPasscodePasswordField1, 1);
});
it('shows OLSKPasscodePasswordField2', function () {
browser.assert.elements(OLSKPasscodePasswordField2, 1);
});
it('shows OLSKPasscodeFutileFieldLabel', function () {
browser.assert.elements(OLSKPasscodeFutileFieldLabel, 1);
});
it('shows OLSKPasscodeFutileField', function () {
browser.assert.elements(OLSKPasscodeFutileField, 1);
});
it('shows OLSKPasscodeContinueButton', function () {
browser.assert.elements(OLSKPasscodeContinueButton, 1);
});
});
context('OLSKModalViewClose', function () {
before(function () {
return browser.pressButton('#TestOLSKModalViewClose');
});
it('hides OLSKPasscode', function () {
browser.assert.elements(OLSKPasscode, 0);
});
});
context('OLSKPasscodeLauncherItemConfigure', function () {
before(function () {
return browser.OLSKLauncherRun('OLSKPasscodeLauncherItemConfigure');
});
it('shows OLSKPasscode', function () {
browser.assert.elements(OLSKPasscode, 1);
});
});
describe('OLSKPasscodeContinueButton', function test_OLSKPasscodeContinueButton () {
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);
});
before(function () {
return browser.pressButton(OLSKPasscodeContinueButton);
});
it('hides OLSKPasscode', function () {
browser.assert.elements(OLSKPasscode, 0);
});
});
});