This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-test-_access.js
128 lines (94 loc) · 2.79 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
124
125
126
127
128
const kDefaultRoute = require('./ui-behaviour.js').OLSKControllerRoutes().shift();
Object.entries({
AppHeading: '.AppHeading',
AppCreate: '.AppCreate',
AppCreateField: '#AppCreateField',
AppCreateButton: '.AppCreateButton',
AppList: '#AppList',
AppListItem: '.AppListItem',
AppListItemToggle: '.AppListItemToggle',
AppListItemName: '.AppListItemName',
AppListItemUpdateField: '.AppListItemUpdateField',
AppListItemUpdateButton: '.AppListItemUpdateButton',
}).map(function (e) {
return global[e.shift()] = e.pop();
});
describe('AppMain_Access', function () {
before(function() {
return browser.OLSKVisit(kDefaultRoute);
});
it('shows AppHeading', function () {
browser.assert.elements(AppHeading, 1);
});
it('shows AppCreateField', function() {
browser.assert.elements(AppCreateField, 1);
});
it('shows AppCreateButton', function () {
browser.assert.elements(AppCreateButton, 1);
});
it('shows AppList', function () {
browser.assert.elements(AppList, 1);
});
it('hides AppListItem', function () {
browser.assert.elements(AppListItem, 0);
});
context('submit empty', function () {
before(function () {
return browser.click(AppCreateButton);
});
it('hides AppListItem', function () {
browser.assert.elements(AppListItem, 0);
});
});
context('submit filled', function () {
before(function () {
return browser.fill(AppCreateField, Math.random().toString());
});
before(function () {
return browser.click(AppCreateButton);
});
it('shows AppListItem', function () {
browser.assert.elements(AppListItem, 1);
});
it('shows AppListItemToggle', function () {
browser.assert.elements(AppListItemToggle, 1);
});
it('shows AppListItemName', function () {
browser.assert.elements(AppListItemName, 1);
});
it('hides AppListItemUpdateField', function() {
browser.assert.elements(AppListItemUpdateField, 0);
});
it('hides AppListItemUpdateButton', function () {
browser.assert.elements(AppListItemUpdateButton, 0);
});
});
context('edit', function () {
before(function () {
return browser.click(AppListItemName);
});
it('hides AppListItemName', function () {
browser.assert.elements(AppListItemName, 0);
});
it('shows AppListItemUpdateField', function() {
browser.assert.elements(AppListItemUpdateField, 1);
});
it('shows AppListItemUpdateButton', function () {
browser.assert.elements(AppListItemUpdateButton, 1);
});
});
context('edit empty', function () {
before(function () {
return browser.fill(AppListItemUpdateField, '');
});
before(function () {
return browser.click(AppListItemUpdateButton);
});
it('hides AppListItem', function () {
browser.assert.elements(AppListItem, 0);
});
});
after(function () {
return browser.evaluate('window.clearXdcStorage()');
});
});