@json-editor/json-editor 2.9.1 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +52 -1
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +462 -124
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/css_integration.html +17 -15
- package/docs/custom-editor.html +92 -0
- package/docs/index.html +4 -1
- package/docs/meta_schema.json +426 -398
- package/package.json +1 -1
- package/src/defaults.js +15 -1
- package/src/editor.js +23 -6
- package/src/editors/multiple.js +76 -8
- package/src/editors/object.js +0 -1
- package/src/iconlibs/bootstrap.js +28 -0
- package/src/iconlibs/index.js +2 -0
- package/src/resolvers.js +5 -2
- package/src/schemaloader.js +3 -1
- package/src/themes/bootstrap3.js +1 -1
- package/src/utilities.js +32 -0
- package/src/validator.js +93 -0
- package/tests/codeceptjs/constrains/contains_test.js +36 -0
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
- package/tests/codeceptjs/constrains/if-then-else_test.js +186 -0
- package/tests/codeceptjs/core_test.js +35 -27
- package/tests/codeceptjs/editors/advanced_test.js +11 -10
- package/tests/codeceptjs/editors/array_any_of_test.js +35 -35
- package/tests/codeceptjs/editors/array_test.js +757 -767
- package/tests/codeceptjs/editors/autocomplete_test.js +1 -3
- package/tests/codeceptjs/editors/button_test.js +25 -24
- package/tests/codeceptjs/editors/checkbox_test.js +17 -16
- package/tests/codeceptjs/editors/colorpicker_test.js +18 -16
- package/tests/codeceptjs/editors/datetime_test.js +7 -7
- package/tests/codeceptjs/editors/inheritance_test.js +7 -8
- package/tests/codeceptjs/editors/integer_test.js +71 -72
- package/tests/codeceptjs/editors/jodit_test.js +16 -17
- package/tests/codeceptjs/editors/multiselect_test.js +5 -5
- package/tests/codeceptjs/editors/number_test.js +64 -65
- package/tests/codeceptjs/editors/object_test.js +39 -13
- package/tests/codeceptjs/editors/option-no_default_values_test.js +4 -4
- package/tests/codeceptjs/editors/programmatic-changes_test.js +2 -3
- package/tests/codeceptjs/editors/range_test.js +1 -3
- package/tests/codeceptjs/editors/select_test.js +3 -5
- package/tests/codeceptjs/editors/stepper_test.js +5 -7
- package/tests/codeceptjs/editors/string_test.js +8 -8
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +7 -9
- package/tests/codeceptjs/editors/uuid_test.js +10 -10
- package/tests/codeceptjs/editors/validation_test.js +1 -1
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1133_test.js +1 -3
- package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +0 -2
- package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +2 -4
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
- package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
- package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
- package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
- package/tests/codeceptjs/meta-schema_test.js +10 -10
- package/tests/codeceptjs/schemaloader_test.js +7 -7
- package/tests/codeceptjs/themes_test.js +31 -0
- package/tests/pages/autocomplete.html +1 -0
- package/tests/pages/contains.html +38 -0
- package/tests/pages/dependentSchemas.html +52 -0
- package/tests/pages/if-else.html +57 -0
- package/tests/pages/if-then-else-allOf.html +117 -0
- package/tests/pages/if-then-else-disable-fields.html +69 -0
- package/tests/pages/if-then-else.html +64 -0
- package/tests/pages/if-then.html +57 -0
- package/tests/pages/issues/issue-gh-1158-2.html +189 -0
- package/tests/pages/issues/issue-gh-1165.html +63 -0
- package/tests/pages/issues/issue-gh-1165.json +8 -0
- package/tests/pages/issues/issue-gh-1211.html +1022 -0
- package/tests/pages/issues/issue-gh-1338.html +74 -0
- package/tests/pages/issues/issue-gh-1347.html +142 -0
- package/tests/pages/issues/issue-gh-795.html +58 -0
- package/tests/pages/issues/issue-gh-810.html +149 -0
- package/tests/pages/keep_only_existing_values.html +80 -0
- package/tests/pages/maxContains.html +39 -0
- package/tests/pages/meta-schema.html +28 -0
- package/tests/pages/meta_schema.json +426 -398
- package/tests/pages/minContains.html +39 -0
- package/tests/pages/option-dependencies.html +106 -0
- package/tests/pages/themes.html +3 -1
- package/tests/unit/core.spec.js +2 -5
- package/tests/codeceptjs/editors/issues/issue-gh-1164_test.js +0 -12
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/* global Feature Scenario */
|
|
2
|
+
|
|
3
|
+
Feature('if-then-else')
|
|
4
|
+
|
|
5
|
+
Scenario('validate agaist allOf of if schemas @if-then-else', async ({ I }) => {
|
|
6
|
+
I.amOnPage('if-then-else-allOf.html')
|
|
7
|
+
I.waitForElement('.je-ready')
|
|
8
|
+
|
|
9
|
+
I.selectOption('[name="root[country]"]', 'United States of America')
|
|
10
|
+
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')
|
|
11
|
+
|
|
12
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
13
|
+
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')
|
|
14
|
+
|
|
15
|
+
I.selectOption('[name="root[country]"]', 'Netherlands')
|
|
16
|
+
I.waitForText('Value must match the pattern [0-9]{4} [A-Z]{2}.')
|
|
17
|
+
|
|
18
|
+
I.fillField('#value', JSON.stringify({
|
|
19
|
+
street_address: '1600 Pennsylvania Avenue NW',
|
|
20
|
+
country: 'United States of America',
|
|
21
|
+
postal_code: '20500'
|
|
22
|
+
}))
|
|
23
|
+
I.click('#set-value')
|
|
24
|
+
I.dontSee('.invalid-feedback')
|
|
25
|
+
|
|
26
|
+
I.fillField('#value', JSON.stringify({
|
|
27
|
+
street_address: '1600 Pennsylvania Avenue NW',
|
|
28
|
+
postal_code: '20500'
|
|
29
|
+
}))
|
|
30
|
+
I.click('#set-value')
|
|
31
|
+
I.dontSee('.invalid-feedback')
|
|
32
|
+
|
|
33
|
+
I.fillField('#value', JSON.stringify({
|
|
34
|
+
street_address: '24 Sussex Drive',
|
|
35
|
+
country: 'Canada',
|
|
36
|
+
postal_code: 'K1M 1M4'
|
|
37
|
+
}))
|
|
38
|
+
I.click('#set-value')
|
|
39
|
+
I.dontSee('.invalid-feedback')
|
|
40
|
+
|
|
41
|
+
I.fillField('#value', JSON.stringify({
|
|
42
|
+
street_address: 'Adriaan Goekooplaan',
|
|
43
|
+
country: 'Netherlands',
|
|
44
|
+
postal_code: '2517 JX'
|
|
45
|
+
}))
|
|
46
|
+
I.click('#set-value')
|
|
47
|
+
I.dontSee('.invalid-feedback')
|
|
48
|
+
|
|
49
|
+
I.fillField('#value', JSON.stringify({
|
|
50
|
+
street_address: '24 Sussex Drive',
|
|
51
|
+
country: 'Canada',
|
|
52
|
+
postal_code: '10000'
|
|
53
|
+
}))
|
|
54
|
+
I.click('#set-value')
|
|
55
|
+
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')
|
|
56
|
+
I.waitForElement('.invalid-feedback')
|
|
57
|
+
|
|
58
|
+
I.fillField('#value', JSON.stringify({
|
|
59
|
+
street_address: '1600 Pennsylvania Avenue NW',
|
|
60
|
+
postal_code: 'K1M 1M4'
|
|
61
|
+
}))
|
|
62
|
+
I.click('#set-value')
|
|
63
|
+
I.waitForElement('.invalid-feedback')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
Scenario('validate agaist if-then-else @if-then-else', async ({ I }) => {
|
|
67
|
+
I.amOnPage('if-then-else.html')
|
|
68
|
+
I.waitForElement('.je-ready')
|
|
69
|
+
|
|
70
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
71
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
72
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
73
|
+
I.pressKey('Tab')
|
|
74
|
+
I.waitForElement('.invalid-feedback')
|
|
75
|
+
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')
|
|
76
|
+
|
|
77
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
78
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
79
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
80
|
+
I.pressKey('Tab')
|
|
81
|
+
I.waitForElement('.invalid-feedback')
|
|
82
|
+
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')
|
|
83
|
+
|
|
84
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
85
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
86
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
87
|
+
I.pressKey('Tab')
|
|
88
|
+
I.dontSee('.invalid-feedback')
|
|
89
|
+
|
|
90
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
91
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
92
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
93
|
+
I.pressKey('Tab')
|
|
94
|
+
I.dontSee('.invalid-feedback')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
Scenario('validate agaist if-then @if-then-else', async ({ I }) => {
|
|
98
|
+
I.amOnPage('if-then.html')
|
|
99
|
+
I.waitForElement('.je-ready')
|
|
100
|
+
|
|
101
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
102
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
103
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
104
|
+
I.pressKey('Tab')
|
|
105
|
+
I.waitForElement('.invalid-feedback')
|
|
106
|
+
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')
|
|
107
|
+
|
|
108
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
109
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
110
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
111
|
+
I.pressKey('Tab')
|
|
112
|
+
I.dontSee('.invalid-feedback')
|
|
113
|
+
|
|
114
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
115
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
116
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
117
|
+
I.pressKey('Tab')
|
|
118
|
+
I.dontSee('.invalid-feedback')
|
|
119
|
+
|
|
120
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
121
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
122
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
123
|
+
I.pressKey('Tab')
|
|
124
|
+
I.dontSee('.invalid-feedback')
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
Scenario('validate agaist if-else @if-then-else', async ({ I }) => {
|
|
128
|
+
I.amOnPage('if-else.html')
|
|
129
|
+
I.waitForElement('.je-ready')
|
|
130
|
+
|
|
131
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
132
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
133
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
134
|
+
I.pressKey('Tab')
|
|
135
|
+
I.dontSee('.invalid-feedback')
|
|
136
|
+
|
|
137
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
138
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
139
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
140
|
+
I.pressKey('Tab')
|
|
141
|
+
I.waitForElement('.invalid-feedback')
|
|
142
|
+
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')
|
|
143
|
+
|
|
144
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
145
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
146
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
147
|
+
I.pressKey('Tab')
|
|
148
|
+
I.dontSee('.invalid-feedback')
|
|
149
|
+
|
|
150
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
151
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
152
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
153
|
+
I.pressKey('Tab')
|
|
154
|
+
I.dontSee('.invalid-feedback')
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
Scenario('validate agaist if-then-else when disabled fields are present in fields @if-then-else', async ({ I }) => {
|
|
158
|
+
I.amOnPage('if-then-else-disable-fields.html')
|
|
159
|
+
I.waitForElement('.je-ready')
|
|
160
|
+
|
|
161
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
162
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
163
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
164
|
+
I.pressKey('Tab')
|
|
165
|
+
I.waitForElement('.invalid-feedback')
|
|
166
|
+
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')
|
|
167
|
+
|
|
168
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
169
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
170
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
171
|
+
I.pressKey('Tab')
|
|
172
|
+
I.waitForElement('.invalid-feedback')
|
|
173
|
+
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')
|
|
174
|
+
|
|
175
|
+
I.selectOption('[name="root[country]"]', 'America')
|
|
176
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
177
|
+
I.fillField('[name="root[postal_code]"]', '10000')
|
|
178
|
+
I.pressKey('Tab')
|
|
179
|
+
I.dontSee('.invalid-feedback')
|
|
180
|
+
|
|
181
|
+
I.selectOption('[name="root[country]"]', 'Canada')
|
|
182
|
+
I.waitForElement('[name="root[postal_code]"]')
|
|
183
|
+
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
|
|
184
|
+
I.pressKey('Tab')
|
|
185
|
+
I.dontSee('.invalid-feedback')
|
|
186
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const assert = require('assert')
|
|
4
4
|
const { DEFAULT_WAIT_TIME } = require('./test-config')
|
|
5
5
|
|
|
6
6
|
Feature('core')
|
|
@@ -65,18 +65,18 @@ Scenario('should destroy', async ({ I }) => {
|
|
|
65
65
|
Scenario('should set and get form value', async ({ I }) => {
|
|
66
66
|
I.amOnPage('core.html')
|
|
67
67
|
I.click('.get-value')
|
|
68
|
-
|
|
68
|
+
I.waitForValue('.value', '{"age":18,"name":"Francesco Avizzano"}')
|
|
69
69
|
I.click('.set-value')
|
|
70
70
|
I.click('.get-value')
|
|
71
|
-
|
|
71
|
+
I.waitForValue('.value', '{"age":40,"name":"John Smith"}')
|
|
72
72
|
})
|
|
73
73
|
|
|
74
74
|
Scenario('should set and get individual values', async ({ I }) => {
|
|
75
75
|
I.amOnPage('core.html')
|
|
76
76
|
I.click('.get-individual-value')
|
|
77
|
-
|
|
77
|
+
I.waitForValue('.value', '"Francesco Avizzano"')
|
|
78
78
|
I.click('.set-individual-value')
|
|
79
|
-
|
|
79
|
+
I.waitForValue('.value', '"john kaminski"')
|
|
80
80
|
})
|
|
81
81
|
|
|
82
82
|
Scenario('should watch a specific field for changes', async ({ I }) => {
|
|
@@ -116,9 +116,9 @@ Scenario('should change the form if form_name_root option is set @core', async (
|
|
|
116
116
|
I.click('[for="form_2[1]"]')
|
|
117
117
|
I.dontSee('Property must be set.', '.invalid-feedback')
|
|
118
118
|
I.click('#get-value-form-1')
|
|
119
|
-
|
|
119
|
+
I.waitForValue('#value-form-1', '"yes"')
|
|
120
120
|
I.click('#get-value-form-2')
|
|
121
|
-
|
|
121
|
+
I.waitForValue('#value-form-2', '"no"')
|
|
122
122
|
})
|
|
123
123
|
|
|
124
124
|
Scenario('should validate against oneOf schemas and display single oneOf and editors error messages @core @oneof', async ({ I }) => {
|
|
@@ -170,6 +170,14 @@ Scenario('should validate against anyOf schemas and display single anyOf and edi
|
|
|
170
170
|
I.dontSee('Property must be set.', '[data-schemapath="root.age"] .invalid-feedback')
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
+
Scenario('should keep only existent values @core @anyof @keep_only_existing_values', async ({ I }) => {
|
|
174
|
+
I.amOnPage('keep_only_existing_values.html')
|
|
175
|
+
I.waitForElement('.je-ready')
|
|
176
|
+
I.waitForValue('#value', '{"name":"Afred","surname":"hitchcock","zip":"12345"}')
|
|
177
|
+
I.selectOption('.je-switcher', 'object 2')
|
|
178
|
+
I.waitForValue('#value', '{"name":"Afred","surname":"hitchcock","other_zip":""}')
|
|
179
|
+
})
|
|
180
|
+
|
|
173
181
|
Scenario('should display anyOf and oneOf error messages in the correct places @848', async ({ I }) => {
|
|
174
182
|
I.amOnPage('issues/issue-gh-848.html')
|
|
175
183
|
I.selectOption('.je-switcher', 'Value, string')
|
|
@@ -182,69 +190,69 @@ Scenario('Should switch between all json 7 data types in @oneof and display erro
|
|
|
182
190
|
I.waitForElement('.je-ready')
|
|
183
191
|
|
|
184
192
|
I.selectOption('.je-switcher', 'Value, string')
|
|
185
|
-
|
|
193
|
+
I.waitForValue('#value', '{"test":""}')
|
|
186
194
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
187
195
|
I.waitForText('Value must be the constant value')
|
|
188
196
|
|
|
189
197
|
I.selectOption('.je-switcher', 'Value, boolean')
|
|
190
|
-
|
|
198
|
+
I.waitForValue('#value', '{"test":false}')
|
|
191
199
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
192
200
|
I.waitForText('Value must be the constant value')
|
|
193
201
|
|
|
194
202
|
I.selectOption('.je-switcher', 'Value, array')
|
|
195
|
-
|
|
203
|
+
I.waitForValue('#value', '{"test":[]}')
|
|
196
204
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
197
205
|
I.waitForText('Value must be the constant value')
|
|
198
206
|
|
|
199
207
|
I.selectOption('.je-switcher', 'Value, object')
|
|
200
|
-
|
|
208
|
+
I.waitForValue('#value', '{"test":{}}')
|
|
201
209
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
202
210
|
I.waitForText('Value must be the constant value')
|
|
203
211
|
I.waitForText('Object is missing the required property \'test\'')
|
|
204
212
|
|
|
205
213
|
I.selectOption('.je-switcher', 'Value, number')
|
|
206
|
-
|
|
214
|
+
I.waitForValue('#value', '{"test":0}')
|
|
207
215
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
208
216
|
I.waitForText('Value must be the constant value')
|
|
209
217
|
|
|
210
218
|
I.selectOption('.je-switcher', 'Value, integer')
|
|
211
|
-
|
|
219
|
+
I.waitForValue('#value', '{"test":0}')
|
|
212
220
|
I.waitForText('Value must validate against exactly one of the provided schemas.')
|
|
213
221
|
I.waitForText('Value must be the constant value')
|
|
214
222
|
|
|
215
223
|
I.selectOption('.je-switcher', 'Value, null')
|
|
216
|
-
|
|
224
|
+
I.waitForValue('#value', '{"test":null}')
|
|
217
225
|
})
|
|
218
226
|
|
|
219
|
-
Scenario('Should switch between all json 7 data types in @anyof and display error messages for each one @core',
|
|
227
|
+
Scenario('Should switch between all json 7 data types in @anyof and display error messages for each one @core', ({ I }) => {
|
|
220
228
|
I.amOnPage('anyof-2.html')
|
|
221
229
|
I.waitForElement('.je-ready')
|
|
222
230
|
|
|
223
|
-
|
|
231
|
+
I.waitForValue('#value', '{"test":""}')
|
|
224
232
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
225
233
|
|
|
226
234
|
I.selectOption('.je-switcher', 'Value, boolean')
|
|
227
|
-
|
|
235
|
+
I.waitForValue('#value', '{"test":false}')
|
|
228
236
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
229
237
|
|
|
230
238
|
I.selectOption('.je-switcher', 'Value, array')
|
|
231
|
-
|
|
239
|
+
I.waitForValue('#value', '{"test":[]}')
|
|
232
240
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
233
241
|
|
|
234
242
|
I.selectOption('.je-switcher', 'Value, object')
|
|
235
|
-
|
|
243
|
+
I.waitForValue('#value', '{"test":{}}')
|
|
236
244
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
237
245
|
|
|
238
246
|
I.selectOption('.je-switcher', 'Value, number')
|
|
239
|
-
|
|
247
|
+
I.waitForValue('#value', '{"test":0}')
|
|
240
248
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
241
249
|
|
|
242
250
|
I.selectOption('.je-switcher', 'Value, integer')
|
|
243
|
-
|
|
251
|
+
I.waitForValue('#value', '{"test":0}')
|
|
244
252
|
I.waitForText('Value must validate against at least one of the provided schemas')
|
|
245
253
|
|
|
246
254
|
I.selectOption('.je-switcher', 'Value, null')
|
|
247
|
-
|
|
255
|
+
I.waitForValue('#value', '{"test":null}')
|
|
248
256
|
})
|
|
249
257
|
|
|
250
258
|
Scenario('should validate against oneOf schemas and display single oneOf and editors error messages @core @translate-property', async ({ I }) => {
|
|
@@ -346,17 +354,17 @@ Scenario('should load internal schema definitions, external schema definitions a
|
|
|
346
354
|
'../fixtures/string.json',
|
|
347
355
|
'../fixtures/definitions.json',
|
|
348
356
|
'../fixtures/basic_person.json',
|
|
349
|
-
'../fixtures/person.json'
|
|
357
|
+
'../fixtures/person.json'
|
|
350
358
|
]
|
|
351
359
|
for (const path of schemaPaths) {
|
|
352
|
-
|
|
360
|
+
const key = 'je-cache::' + currentPath + path
|
|
353
361
|
|
|
354
362
|
const item = await I.executeScript(function (storageKey) {
|
|
355
|
-
return window.localStorage.getItem(storageKey)
|
|
363
|
+
return window.localStorage.getItem(storageKey)
|
|
356
364
|
}, key)
|
|
357
365
|
const itemDecoded = JSON.parse(item)
|
|
358
|
-
assert.
|
|
359
|
-
assert(itemDecoded, 'Cached schema found')
|
|
366
|
+
assert.strictEqual(itemDecoded.cacheBuster, 'abc123')
|
|
367
|
+
assert(itemDecoded, 'Cached schema found')
|
|
360
368
|
}
|
|
361
369
|
})
|
|
362
370
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/* global Feature Scenario */
|
|
1
2
|
|
|
2
|
-
Feature('Advanced Editor')
|
|
3
|
+
Feature('Advanced Editor')
|
|
3
4
|
|
|
4
5
|
Scenario('test validation & delete', ({ I }) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
6
|
+
I.amOnPage('advanced.html')
|
|
7
|
+
I.retry({ retries: 5, minTimeout: 500 }).seeElement('#valid_indicator')
|
|
8
|
+
I.see('valid', '#valid_indicator')
|
|
9
|
+
I.fillField('root[0][location][city]', 'Stuttgart')
|
|
10
|
+
I.waitForValue("[name='root[0][location][city]']", 'Stuttgart')
|
|
11
|
+
I.amAcceptingPopups()
|
|
12
|
+
I.click('.json-editor-btntype-deletelast')
|
|
13
|
+
I.acceptPopup()
|
|
14
|
+
})
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const assert = require('assert')
|
|
4
|
+
let value
|
|
5
|
+
|
|
6
|
+
Feature('anyof in array')
|
|
4
7
|
|
|
5
8
|
Scenario('should have correct initial value', async ({ I }) => {
|
|
6
|
-
I.amOnPage('array-anyof.html')
|
|
7
|
-
I.click('.get-value')
|
|
8
|
-
|
|
9
|
-
})
|
|
9
|
+
I.amOnPage('array-anyof.html')
|
|
10
|
+
I.click('.get-value')
|
|
11
|
+
I.waitForValue('.debug', '{"correct":"","items":[]}')
|
|
12
|
+
})
|
|
10
13
|
|
|
11
14
|
Scenario('should show errors @optional', async ({ I }) => {
|
|
12
|
-
I.amOnPage('array-anyof.html')
|
|
13
|
-
I.seeElement('[data-schemapath="root"]')
|
|
14
|
-
I.seeElement('[data-schemapath="root.items"]')
|
|
15
|
+
I.amOnPage('array-anyof.html')
|
|
16
|
+
I.seeElement('[data-schemapath="root"]')
|
|
17
|
+
I.seeElement('[data-schemapath="root.items"]')
|
|
15
18
|
|
|
16
|
-
I.click('.get-value')
|
|
17
|
-
|
|
18
|
-
assert.equal(value, '{"correct":"","items":[]}');
|
|
19
|
+
I.click('.get-value')
|
|
20
|
+
I.waitForValue('.debug', '{"correct":"","items":[]}')
|
|
19
21
|
|
|
20
|
-
I.fillField('root[correct]', 'a')
|
|
21
|
-
assert.
|
|
22
|
+
I.fillField('root[correct]', 'a')
|
|
23
|
+
assert.strictEqual(await I.dontSee('Value must match the pattern ^[a-zA-Z0-9_]+$.'), true, 'should show warning')
|
|
22
24
|
|
|
23
|
-
I.fillField('root[correct]', 'a!')
|
|
24
|
-
assert.
|
|
25
|
-
assert.
|
|
25
|
+
I.fillField('root[correct]', 'a!')
|
|
26
|
+
assert.strictEqual(await I.seeInField('root[correct]', 'a!'), true, 'fillField failed')
|
|
27
|
+
assert.strictEqual(await I.see('Value must match the pattern ^[a-zA-Z0-9_]+$.'), true, 'should show warning')
|
|
26
28
|
|
|
27
|
-
I.clearField('root[correct]')
|
|
28
|
-
I.seeInField('root[correct]', '')
|
|
29
|
-
assert.
|
|
29
|
+
I.clearField('root[correct]')
|
|
30
|
+
I.seeInField('root[correct]', '')
|
|
31
|
+
assert.strictEqual(await I.see('Value must match the pattern ^[a-zA-Z0-9_]+$.'), true, 'should show warning')
|
|
30
32
|
|
|
31
|
-
I.fillField('root[correct]', 'a')
|
|
32
|
-
I.dontSee('Value must match the pattern ^[a-zA-Z0-9_]+$.')
|
|
33
|
+
I.fillField('root[correct]', 'a')
|
|
34
|
+
I.dontSee('Value must match the pattern ^[a-zA-Z0-9_]+$.')
|
|
33
35
|
|
|
34
|
-
I.click('.json-editor-btntype-add')
|
|
35
|
-
I.click('.get-value')
|
|
36
|
-
|
|
37
|
-
assert.equal(value, '{"correct":"a","items":[{"handler":"aaa","id":"","___a":""}]}');
|
|
36
|
+
I.click('.json-editor-btntype-add')
|
|
37
|
+
I.click('.get-value')
|
|
38
|
+
I.waitForValue('.debug', '{"correct":"a","items":[{"handler":"aaa","id":"","___a":""}]}')
|
|
38
39
|
|
|
39
|
-
I.fillField('root[items][0][id]', 'a')
|
|
40
|
-
I.dontSee('Value must match the pattern ^[a-zA-Z0-9_]+$.')
|
|
40
|
+
I.fillField('root[items][0][id]', 'a')
|
|
41
|
+
I.dontSee('Value must match the pattern ^[a-zA-Z0-9_]+$.')
|
|
41
42
|
|
|
42
|
-
I.clearField('root[items][0][id]')
|
|
43
|
-
I.seeInField('root[items][0][id]', '')
|
|
43
|
+
I.clearField('root[items][0][id]')
|
|
44
|
+
I.seeInField('root[items][0][id]', '')
|
|
44
45
|
// todo still not work
|
|
45
|
-
assert.
|
|
46
|
-
|
|
47
|
-
I.fillField('root[items][0][id]', 'a!');
|
|
48
|
-
I.see('Value must match the pattern ^[a-zA-Z0-9_]+$.');
|
|
46
|
+
assert.strictEqual(await I.see('Value must match the pattern ^[a-zA-Z0-9_]+$.'), true, 'should show warning')
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
I.fillField('root[items][0][id]', 'a!')
|
|
49
|
+
I.see('Value must match the pattern ^[a-zA-Z0-9_]+$.')
|
|
50
|
+
})
|