@json-editor/json-editor 2.9.0 → 2.10.0
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/.github/workflows/build.yml +2 -0
- package/CHANGELOG.md +29 -7
- package/README.md +47 -1
- package/config/codeceptjs_helpers.js +4 -8
- package/config/karma.conf.js +0 -4
- package/config/webpack.common.js +1 -1
- package/config/webpack.dev.js +1 -1
- package/config/webpack.nonmin.js +1 -1
- package/config/webpack.prod.js +0 -1
- package/dist/dev/jsoneditor.js +3687 -0
- package/dist/jsoneditor.js +2 -14
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/jsoneditor.js.map +1 -1
- package/dist/nonmin/jsoneditor.js +25744 -26450
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/css_integration.html +17 -15
- package/docs/custom-editor.html +92 -0
- package/docs/datetime.html +37 -2
- package/docs/index.html +4 -1
- package/docs/meta_schema.json +426 -398
- package/package.json +26 -24
- package/src/defaults.js +15 -1
- package/src/editor.js +23 -6
- package/src/editors/integer.js +5 -3
- package/src/editors/multiple.js +67 -8
- package/src/editors/number.js +5 -3
- package/src/editors/object.js +0 -1
- package/src/editors/radio.js +4 -6
- package/src/editors/select.js +0 -6
- 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 +22 -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 +143 -0
- package/tests/codeceptjs/core_test.js +46 -46
- package/tests/codeceptjs/editors/advanced_test.js +12 -11
- package/tests/codeceptjs/editors/array_any_of_test.js +37 -37
- package/tests/codeceptjs/editors/array_test.js +784 -794
- package/tests/codeceptjs/editors/autocomplete_test.js +4 -6
- package/tests/codeceptjs/editors/button_test.js +30 -29
- package/tests/codeceptjs/editors/checkbox_test.js +19 -18
- package/tests/codeceptjs/editors/colorpicker_test.js +20 -18
- package/tests/codeceptjs/editors/datetime_test.js +11 -11
- package/tests/codeceptjs/editors/inheritance_test.js +8 -9
- package/tests/codeceptjs/editors/integer_test.js +77 -78
- package/tests/codeceptjs/editors/jodit_test.js +18 -19
- package/tests/codeceptjs/editors/multiselect_test.js +6 -6
- package/tests/codeceptjs/editors/number_test.js +72 -71
- package/tests/codeceptjs/editors/object_test.js +52 -26
- package/tests/codeceptjs/editors/option-no_default_values_test.js +6 -6
- package/tests/codeceptjs/editors/programmatic-changes_test.js +4 -5
- package/tests/codeceptjs/editors/radio_test.js +1 -1
- package/tests/codeceptjs/editors/range_test.js +2 -4
- package/tests/codeceptjs/editors/rating_test.js +1 -1
- package/tests/codeceptjs/editors/select_test.js +5 -7
- package/tests/codeceptjs/editors/stepper_test.js +8 -10
- package/tests/codeceptjs/editors/string_test.js +16 -16
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +11 -13
- package/tests/codeceptjs/editors/tabs_test.js +1 -1
- package/tests/codeceptjs/editors/uuid_test.js +15 -15
- package/tests/codeceptjs/editors/validation_test.js +2 -2
- package/tests/codeceptjs/issues/issue-gh-1133_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +1 -3
- 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 +3 -5
- 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 +12 -12
- package/tests/codeceptjs/schemaloader_test.js +8 -8
- package/tests/codeceptjs/themes_test.js +40 -9
- 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.html +64 -0
- package/tests/pages/if-then.html +57 -0
- package/tests/pages/issues/issue-gh-1133.html +64 -0
- package/tests/pages/issues/issue-gh-1158-2.html +189 -0
- package/tests/pages/issues/issue-gh-1164.html +71 -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/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/number.html +18 -0
- package/tests/pages/option-dependencies.html +106 -0
- package/tests/pages/themes.html +3 -1
- package/tests/unit/core.spec.js +8 -10
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
|
@@ -5,26 +5,26 @@ const { DEFAULT_WAIT_TIME } = require('../test-config')
|
|
|
5
5
|
|
|
6
6
|
Feature('object')
|
|
7
7
|
|
|
8
|
-
Scenario('should respect property orders', async (I) => {
|
|
8
|
+
Scenario('should respect property orders', async ({ I }) => {
|
|
9
9
|
I.amOnPage('object.html')
|
|
10
|
-
assert.
|
|
11
|
-
assert.
|
|
12
|
-
assert.
|
|
13
|
-
assert.
|
|
14
|
-
assert.
|
|
10
|
+
assert.strictEqual(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(1) [data-schemapath^="root."]', 'data-schemapath'), 'root.age')
|
|
11
|
+
assert.strictEqual(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(2) [data-schemapath^="root."]', 'data-schemapath'), 'root.name')
|
|
12
|
+
assert.strictEqual(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(3) [data-schemapath^="root."]', 'data-schemapath'), 'root.single')
|
|
13
|
+
assert.strictEqual(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(4) [data-schemapath^="root."]', 'data-schemapath'), 'root.values')
|
|
14
|
+
assert.strictEqual(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(5) [data-schemapath^="root."]', 'data-schemapath'), 'root.zodiac')
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
Scenario('should validate required properties', async (I) => {
|
|
17
|
+
Scenario('should validate required properties', async ({ I }) => {
|
|
18
18
|
I.amOnPage('object.html')
|
|
19
19
|
I.see('Value must be at least 18.')
|
|
20
20
|
})
|
|
21
21
|
|
|
22
|
-
Scenario('should validate also not required properties', async (I) => {
|
|
22
|
+
Scenario('should validate also not required properties', async ({ I }) => {
|
|
23
23
|
I.amOnPage('object.html')
|
|
24
24
|
I.see('Value must be at least 3 characters long.')
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
Scenario('grid-strict rows and columns', (I) => {
|
|
27
|
+
Scenario('grid-strict rows and columns', ({ I }) => {
|
|
28
28
|
I.amOnPage('grid-strict.html')
|
|
29
29
|
I.seeNumberOfVisibleElements('.row', 13)
|
|
30
30
|
I.seeElement('.col-md-1')
|
|
@@ -52,7 +52,7 @@ Scenario('grid-strict rows and columns', (I) => {
|
|
|
52
52
|
I.seeElement('.col-md-1.offset-md-11')
|
|
53
53
|
})
|
|
54
54
|
|
|
55
|
-
Scenario('grid rows and columns', (I) => {
|
|
55
|
+
Scenario('grid rows and columns', ({ I }) => {
|
|
56
56
|
I.amOnPage('grid.html')
|
|
57
57
|
I.seeNumberOfVisibleElements('.row', 6)
|
|
58
58
|
I.seeNumberOfVisibleElements('.col-md-12', 1)
|
|
@@ -63,7 +63,7 @@ Scenario('grid rows and columns', (I) => {
|
|
|
63
63
|
I.seeNumberOfVisibleElements('.col-md-1', 6)
|
|
64
64
|
})
|
|
65
65
|
|
|
66
|
-
Scenario('opt in optional properties @show_opt_in', async (I) => {
|
|
66
|
+
Scenario('opt in optional properties @show_opt_in', async ({ I }) => {
|
|
67
67
|
I.amOnPage('object-required-properties.html')
|
|
68
68
|
|
|
69
69
|
// if an editor type "object" is disabled, also the child editors opt-in controls will be disabled.
|
|
@@ -88,7 +88,7 @@ Scenario('opt in optional properties @show_opt_in', async (I) => {
|
|
|
88
88
|
I.seeDisabledAttribute('[data-schemapath="root.object.radio"] .json-editor-opt-in')
|
|
89
89
|
|
|
90
90
|
I.click('.get-value')
|
|
91
|
-
|
|
91
|
+
I.waitForValue('.value', '{"number":0,"boolean":false}')
|
|
92
92
|
|
|
93
93
|
// Opening and Closing "Edit JSON" should keep opt-in state.
|
|
94
94
|
|
|
@@ -112,26 +112,26 @@ Scenario('opt in optional properties @show_opt_in', async (I) => {
|
|
|
112
112
|
I.seeDisabledAttribute('[data-schemapath="root.object.radio"] .json-editor-opt-in')
|
|
113
113
|
|
|
114
114
|
I.click('.get-value')
|
|
115
|
-
|
|
115
|
+
I.waitForValue('.value', '{"number":0,"boolean":false}')
|
|
116
116
|
|
|
117
117
|
// opt-in string property
|
|
118
118
|
|
|
119
119
|
I.click('[data-schemapath="root.string"] .json-editor-opt-in')
|
|
120
120
|
I.click('[data-schemapath="root.radio"] .json-editor-opt-in')
|
|
121
121
|
I.click('.get-value')
|
|
122
|
-
|
|
122
|
+
I.waitForValue('.value', '{"string":"","number":0,"boolean":false,"radio":"Home"}')
|
|
123
123
|
|
|
124
124
|
// opt-in array property
|
|
125
125
|
|
|
126
126
|
I.click('[data-schemapath="root.array"] .json-editor-opt-in')
|
|
127
127
|
I.click('.get-value')
|
|
128
|
-
|
|
128
|
+
I.waitForValue('.value', '{"string":"","number":0,"boolean":false,"radio":"Home","array":[]}')
|
|
129
129
|
|
|
130
130
|
// opt-in object property
|
|
131
131
|
|
|
132
132
|
I.click('[data-schemapath="root.object"] .json-editor-opt-in')
|
|
133
133
|
I.click('.get-value')
|
|
134
|
-
|
|
134
|
+
I.waitForValue('.value', '{"string":"","number":0,"boolean":false,"radio":"Home","array":[],"object":{"string":"","array":[]}}')
|
|
135
135
|
|
|
136
136
|
// if an editor type "object" is enabled, also the child editors opt-in controls will be enabled.
|
|
137
137
|
I.dontSeeDisabledAttribute('[data-schemapath="root.object.number"] .json-editor-opt-in')
|
|
@@ -139,7 +139,7 @@ Scenario('opt in optional properties @show_opt_in', async (I) => {
|
|
|
139
139
|
I.dontSeeDisabledAttribute('[data-schemapath="root.object.radio"] .json-editor-opt-in')
|
|
140
140
|
})
|
|
141
141
|
|
|
142
|
-
Scenario('set value opt in optional properties @show_opt_in', async (I) => {
|
|
142
|
+
Scenario('set value opt in optional properties @show_opt_in', async ({ I }) => {
|
|
143
143
|
I.amOnPage('object-required-properties.html')
|
|
144
144
|
|
|
145
145
|
// all editors visible
|
|
@@ -157,12 +157,12 @@ Scenario('set value opt in optional properties @show_opt_in', async (I) => {
|
|
|
157
157
|
// set values
|
|
158
158
|
I.click('.set-value')
|
|
159
159
|
I.click('.get-value')
|
|
160
|
-
|
|
160
|
+
I.waitForValue('.value', '{"string":"test","number":0,"boolean":false,"array":["test"],"object":{"string":"","number":10,"boolean":true,"array":[]}}')
|
|
161
161
|
|
|
162
162
|
// set empty values
|
|
163
163
|
I.click('.set-empty-value')
|
|
164
164
|
I.click('.get-value')
|
|
165
|
-
|
|
165
|
+
I.waitForValue('.value', '{"number":0,"boolean":false}')
|
|
166
166
|
|
|
167
167
|
// all editorsstill visible
|
|
168
168
|
I.waitForElement('[data-schemapath="root.string"]', DEFAULT_WAIT_TIME)
|
|
@@ -177,7 +177,7 @@ Scenario('set value opt in optional properties @show_opt_in', async (I) => {
|
|
|
177
177
|
I.waitForElement('[data-schemapath="root.object.radio"]', DEFAULT_WAIT_TIME)
|
|
178
178
|
})
|
|
179
179
|
|
|
180
|
-
Scenario('set value opt in optional properties @show_opt_in_schema', async (I) => {
|
|
180
|
+
Scenario('set value opt in optional properties @show_opt_in_schema', async ({ I }) => {
|
|
181
181
|
I.amOnPage('object-show-opt-in.html')
|
|
182
182
|
|
|
183
183
|
// all editors visible
|
|
@@ -209,17 +209,17 @@ Scenario('set value opt in optional properties @show_opt_in_schema', async (I) =
|
|
|
209
209
|
I.dontSeeElement('[data-schemapath="root.option_show_opt_in_false.string"] .json-editor-opt-in') // global show_opt_in: true && parent editor show_opt_in: false
|
|
210
210
|
})
|
|
211
211
|
|
|
212
|
-
Scenario('objects should contain properties defined with the properties keyword unless the property "additionalProperties: true" is specified in the object schema @additional-properties', async (I) => {
|
|
212
|
+
Scenario('objects should contain properties defined with the properties keyword unless the property "additionalProperties: true" is specified in the object schema @additional-properties', async ({ I }) => {
|
|
213
213
|
I.amOnPage('object-no-additional-properties.html')
|
|
214
214
|
I.seeElement('[data-schemapath="root.aptrue.name"] input')
|
|
215
215
|
I.seeElement('[data-schemapath="root.aptrue.age"] input')
|
|
216
216
|
I.seeElement('[data-schemapath="root.apfalse.name"] input')
|
|
217
217
|
I.dontSeeElement('[data-schemapath="root.apfalse.age"] input')
|
|
218
218
|
I.click('.get-value')
|
|
219
|
-
|
|
219
|
+
I.waitForValue('.value', '{"aptrue":{"name":"Albert","age":0},"apfalse":{"name":"Albert"}}')
|
|
220
220
|
})
|
|
221
221
|
|
|
222
|
-
Scenario('should have unique ids', (I) => {
|
|
222
|
+
Scenario('should have unique ids', ({ I }) => {
|
|
223
223
|
I.amOnPage('object-no-duplicated-id.html')
|
|
224
224
|
I.donSeeDuplicatedIds()
|
|
225
225
|
I.waitForText('i am actually a cat')
|
|
@@ -232,7 +232,7 @@ Scenario('should have unique ids', (I) => {
|
|
|
232
232
|
I.waitForText('i am actually a cat')
|
|
233
233
|
})
|
|
234
234
|
|
|
235
|
-
Scenario('should hide properties with unfulfilled dependencies @dependencies', (I) => {
|
|
235
|
+
Scenario('should hide properties with unfulfilled dependencies @dependencies', ({ I }) => {
|
|
236
236
|
I.amOnPage('object-with-dependencies.html')
|
|
237
237
|
I.seeElement('[data-schemapath="root.enable_option"] input')
|
|
238
238
|
I.dontSeeElement('[data-schemapath="root.make_new"] input')
|
|
@@ -244,7 +244,33 @@ Scenario('should hide properties with unfulfilled dependencies @dependencies', (
|
|
|
244
244
|
I.dontSeeElement('[data-schemapath="root.existing_name"] input')
|
|
245
245
|
})
|
|
246
246
|
|
|
247
|
-
Scenario('should
|
|
247
|
+
Scenario('should fulfill dependencies whit fully qualified paths @dependencies', ({ I }) => {
|
|
248
|
+
I.amOnPage('option-dependencies.html')
|
|
249
|
+
I.waitForText('Female specific question?')
|
|
250
|
+
I.waitForText('Female specific age question?')
|
|
251
|
+
I.dontSee('Male specific question?')
|
|
252
|
+
I.dontSee('Male specific age question?')
|
|
253
|
+
I.dontSee('What is your preferred gender?')
|
|
254
|
+
I.dontSee('Other specific age question?')
|
|
255
|
+
|
|
256
|
+
I.selectOption('[id="root[gender]"]', 'male')
|
|
257
|
+
I.dontSee('Female specific question?')
|
|
258
|
+
I.dontSee('Female specific age question?')
|
|
259
|
+
I.waitForText('Male specific question?')
|
|
260
|
+
I.waitForText('Male specific age question?')
|
|
261
|
+
I.dontSee('What is your preferred gender?')
|
|
262
|
+
I.dontSee('Other specific age question?')
|
|
263
|
+
|
|
264
|
+
I.selectOption('[id="root[gender]"]', 'other')
|
|
265
|
+
I.dontSee('Female specific question?')
|
|
266
|
+
I.dontSee('Female specific age question?')
|
|
267
|
+
I.dontSee('Male specific question?')
|
|
268
|
+
I.dontSee('Male specific age question?')
|
|
269
|
+
I.waitForText('What is your preferred gender?')
|
|
270
|
+
I.waitForText('Other specific age question?')
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
Scenario('should respect multiple dependency values @dependencies', ({ I }) => {
|
|
248
274
|
I.amOnPage('object-with-dependencies-array.html')
|
|
249
275
|
I.waitForVisible('[data-schemapath="root.question_1"] select', DEFAULT_WAIT_TIME)
|
|
250
276
|
I.selectOption('[name="root[question_1]"]', 'a')
|
|
@@ -266,7 +292,7 @@ Scenario('should respect multiple dependency values @dependencies', (I) => {
|
|
|
266
292
|
I.waitForInvisible('[data-schemapath="root.question_2_feedback"]', DEFAULT_WAIT_TIME)
|
|
267
293
|
})
|
|
268
294
|
|
|
269
|
-
Scenario('should open and close the properties modal', (I) => {
|
|
295
|
+
Scenario('should open and close the properties modal', ({ I }) => {
|
|
270
296
|
I.amOnPage('object.html')
|
|
271
297
|
I.seeElement('.json-editor-btn-edit_properties')
|
|
272
298
|
I.click('.json-editor-btn-edit_properties')
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
3
|
Feature('option no_default_values')
|
|
4
4
|
|
|
5
|
-
Scenario('should have correct initial value @no_default_values', async (I) => {
|
|
5
|
+
Scenario('should have correct initial value @no_default_values', async ({ I }) => {
|
|
6
6
|
I.amOnPage('option-no_default_values.html')
|
|
7
7
|
I.click('.get-value')
|
|
8
|
-
|
|
8
|
+
I.waitForValue('.debug', JSON.stringify({
|
|
9
9
|
integer: undefined,
|
|
10
10
|
number: undefined,
|
|
11
11
|
string: undefined
|
|
12
12
|
}))
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
Scenario('should have correct values on empty dirty field', async (I) => {
|
|
15
|
+
Scenario('should have correct values on empty dirty field', async ({ I }) => {
|
|
16
16
|
I.amOnPage('option-no_default_values.html')
|
|
17
17
|
I.click('.get-value')
|
|
18
18
|
|
|
@@ -22,7 +22,7 @@ Scenario('should have correct values on empty dirty field', async (I) => {
|
|
|
22
22
|
I.click('.force-change')
|
|
23
23
|
I.click('.get-value')
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
I.waitForValue('.debug', JSON.stringify({
|
|
26
26
|
number: 3.0,
|
|
27
27
|
string: 'foo',
|
|
28
28
|
integer: 3
|
|
@@ -34,7 +34,7 @@ Scenario('should have correct values on empty dirty field', async (I) => {
|
|
|
34
34
|
I.click('.force-change')
|
|
35
35
|
I.click('.get-value')
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
I.waitForValue('.debug', JSON.stringify({
|
|
38
38
|
number: undefined,
|
|
39
39
|
string: '',
|
|
40
40
|
integer: undefined
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
3
|
const { DEFAULT_WAIT_TIME } = require('../test-config')
|
|
5
4
|
|
|
6
5
|
Feature('Programmatic changes')
|
|
7
6
|
|
|
8
|
-
Scenario('should have correct initial value', async (I) => {
|
|
7
|
+
Scenario('should have correct initial value', async ({ I }) => {
|
|
9
8
|
I.amOnPage('programmatic-changes.html')
|
|
10
9
|
I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
|
|
11
10
|
I.click('.get-value')
|
|
12
|
-
|
|
11
|
+
I.waitForValue('.value', '{"boolean":false,"boolean_checkbox":false,"string":"","integer":0,"number":0,"array":[],"array_checkbox":[],"array_select":[]}')
|
|
13
12
|
})
|
|
14
13
|
|
|
15
|
-
Scenario('should have correct values after setting them programmatically', async (I) => {
|
|
14
|
+
Scenario('should have correct values after setting them programmatically', async ({ I }) => {
|
|
16
15
|
I.amOnPage('programmatic-changes.html')
|
|
17
16
|
I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
|
|
18
17
|
I.click('.set-values')
|
|
19
18
|
I.click('.get-value')
|
|
20
|
-
|
|
19
|
+
I.waitForValue('.value', '{"boolean":true,"boolean_checkbox":true,"string":"hello","integer":5,"number":5.5,"array":[1,2,3],"array_checkbox":["value1","value2"],"array_select":[1,2,3]}')
|
|
21
20
|
})
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
|
-
|
|
5
3
|
Feature('range')
|
|
6
4
|
|
|
7
|
-
Scenario('should have and display initial value @range', async (I) => {
|
|
5
|
+
Scenario('should have and display initial value @range', async ({ I }) => {
|
|
8
6
|
I.amOnPage('range.html')
|
|
9
7
|
I.click('.get-value')
|
|
10
|
-
|
|
8
|
+
I.waitForValue('.value', '{"speed":1}')
|
|
11
9
|
I.waitForText('1', 5, 'output')
|
|
12
10
|
})
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
|
-
|
|
5
3
|
Feature('select')
|
|
6
4
|
|
|
7
|
-
Scenario('should return correct booleans values when selected', async (I) => {
|
|
5
|
+
Scenario('should return correct booleans values when selected', async ({ I }) => {
|
|
8
6
|
I.amOnPage('select.html')
|
|
9
7
|
I.click('.get-value')
|
|
10
|
-
|
|
8
|
+
I.waitForValue('.value', '{"boolean":true}')
|
|
11
9
|
I.selectOption('[name="root[boolean]"]', 'false')
|
|
12
10
|
I.click('.get-value')
|
|
13
|
-
|
|
11
|
+
I.waitForValue('.value', '{"boolean":false}')
|
|
14
12
|
I.selectOption('[name="root[boolean]"]', 'true')
|
|
15
13
|
I.click('.get-value')
|
|
16
|
-
|
|
14
|
+
I.waitForValue('.value', '{"boolean":true}')
|
|
17
15
|
})
|
|
18
16
|
|
|
19
|
-
Scenario('should be disabled if "readonly" is specified', async (I) => {
|
|
17
|
+
Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
|
|
20
18
|
I.amOnPage('read-only.html')
|
|
21
19
|
I.seeDisabledAttribute('[name="root[select]"]')
|
|
22
20
|
})
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
|
-
|
|
5
3
|
Feature('stepper')
|
|
6
4
|
|
|
7
|
-
Scenario('should validate value @stepper', async (I) => {
|
|
5
|
+
Scenario('should validate value @stepper', async ({ I }) => {
|
|
8
6
|
I.amOnPage('stepper.html')
|
|
9
7
|
I.click('.get-value')
|
|
10
8
|
I.see('Property must be set.', '[data-schemapath="root.stepper"] div')
|
|
11
|
-
|
|
9
|
+
I.waitForValue('.value', '{}')
|
|
12
10
|
})
|
|
13
11
|
|
|
14
|
-
Scenario('should be constrained to maximun and minimun values when stepped @stepper', async (I) => {
|
|
12
|
+
Scenario('should be constrained to maximun and minimun values when stepped @stepper', async ({ I }) => {
|
|
15
13
|
I.amOnPage('stepper.html')
|
|
16
14
|
I.click('.stepper-up')
|
|
17
15
|
I.click('.stepper-up')
|
|
18
16
|
I.click('.stepper-up')
|
|
19
17
|
I.click('.get-value')
|
|
20
18
|
I.click('.get-value')
|
|
21
|
-
|
|
19
|
+
I.waitForValue('.value', '{"stepper":6}')
|
|
22
20
|
I.click('.stepper-down')
|
|
23
21
|
I.click('.stepper-down')
|
|
24
22
|
I.click('.stepper-down')
|
|
25
23
|
I.click('.get-value')
|
|
26
|
-
|
|
24
|
+
I.waitForValue('.value', '{"stepper":5}')
|
|
27
25
|
})
|
|
28
26
|
|
|
29
|
-
Scenario('should be correct initialized when manually set @stepper', async (I) => {
|
|
27
|
+
Scenario('should be correct initialized when manually set @stepper', async ({ I }) => {
|
|
30
28
|
I.amOnPage('stepper-manual.html')
|
|
31
29
|
I.fillField('[name="root[stepper]"]', 10)
|
|
32
30
|
I.click('.stepper-up')
|
|
33
31
|
I.click('.get-value')
|
|
34
|
-
|
|
32
|
+
I.waitForValue('.value', '{"stepper":11}')
|
|
35
33
|
I.click('.stepper-down')
|
|
36
34
|
I.click('.stepper-down')
|
|
37
35
|
I.click('.get-value')
|
|
38
|
-
|
|
36
|
+
I.waitForValue('.value', '{"stepper":9}')
|
|
39
37
|
})
|
|
@@ -4,13 +4,13 @@ var assert = require('assert')
|
|
|
4
4
|
|
|
5
5
|
Feature('string')
|
|
6
6
|
|
|
7
|
-
Scenario('should have correct initial value', async (I) => {
|
|
7
|
+
Scenario('ace editor should have correct initial value', async ({ I }) => {
|
|
8
8
|
I.amOnPage('string-ace-editor.html')
|
|
9
9
|
I.click('.get-value')
|
|
10
|
-
|
|
10
|
+
I.waitForValue('.debug', '[]')
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
Scenario('should have coerent values', async (I) => {
|
|
13
|
+
Scenario('should have coerent values', async ({ I }) => {
|
|
14
14
|
I.amOnPage('string-ace-editor.html')
|
|
15
15
|
I.click('Add item')
|
|
16
16
|
I.see('item 1')
|
|
@@ -21,16 +21,16 @@ Scenario('should have coerent values', async (I) => {
|
|
|
21
21
|
I.see('__YELLOW__')
|
|
22
22
|
|
|
23
23
|
I.click('.get-value')
|
|
24
|
-
|
|
24
|
+
I.waitForValue('.debug', JSON.stringify([{ editor: '__YELLOW__' }]))
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
Scenario('should have correct initial value', async (I) => {
|
|
27
|
+
Scenario('sceditor should have correct initial value', async ({ I }) => {
|
|
28
28
|
I.amOnPage('string-sceditor.html')
|
|
29
29
|
I.click('.get-value')
|
|
30
|
-
|
|
30
|
+
I.waitForValue('.debug', '[]')
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
Scenario('editor value and String editor should have coerent values @optional', async (I) => {
|
|
33
|
+
Scenario('editor value and String editor should have coerent values @optional', async ({ I }) => {
|
|
34
34
|
I.amOnPage('string-sceditor.html')
|
|
35
35
|
I.click('Add item')
|
|
36
36
|
I.see('item 1')
|
|
@@ -43,10 +43,10 @@ Scenario('editor value and String editor should have coerent values @optional',
|
|
|
43
43
|
I.switchTo()
|
|
44
44
|
|
|
45
45
|
I.click('.get-value')
|
|
46
|
-
|
|
46
|
+
I.waitForValue('.debug', JSON.stringify([{ editor: '<p>__YELLOW__</p>' }]))
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
-
Scenario('Should work correctly in arrays @optional', async (I) => {
|
|
49
|
+
Scenario('Should work correctly in arrays @optional', async ({ I }) => {
|
|
50
50
|
I.amOnPage('string-sceditor.html')
|
|
51
51
|
I.click('Add item')
|
|
52
52
|
I.click('Add item')
|
|
@@ -79,11 +79,11 @@ Scenario('Should work correctly in arrays @optional', async (I) => {
|
|
|
79
79
|
I.switchTo()
|
|
80
80
|
|
|
81
81
|
I.click('.get-value')
|
|
82
|
-
|
|
82
|
+
I.waitForValue('.debug', JSON.stringify([{ editor: '<p>__YELLOW__<br></p>' }, { editor: '<p>__BLUE__<br></p>' }]))
|
|
83
83
|
|
|
84
84
|
I.click('.json-editor-btn-movedown')
|
|
85
85
|
I.click('.get-value')
|
|
86
|
-
|
|
86
|
+
I.waitForValue('.debug', JSON.stringify([{ editor: '<p>__BLUE__<br></p>' }, { editor: '<p>__YELLOW__<br></p>' }]))
|
|
87
87
|
|
|
88
88
|
// the last 2 tests will fail because Sceditors iframes loose their content when the iframe is reloaded.
|
|
89
89
|
|
|
@@ -98,21 +98,21 @@ Scenario('Should work correctly in arrays @optional', async (I) => {
|
|
|
98
98
|
I.switchTo()
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
-
Scenario('should be readonly if specified and not disabled', async (I) => {
|
|
101
|
+
Scenario('should be readonly if specified and not disabled', async ({ I }) => {
|
|
102
102
|
I.amOnPage('read-only.html')
|
|
103
103
|
I.seeReadOnlyAttribute('[name="root[string]"]')
|
|
104
104
|
})
|
|
105
105
|
|
|
106
|
-
Scenario('should have a custom attribute with custom value', async (I) => {
|
|
106
|
+
Scenario('should have a custom attribute with custom value', async ({ I }) => {
|
|
107
107
|
I.amOnPage('string-custom-attributes.html')
|
|
108
108
|
I.seeElement('[name="root[custom_attributes]"]')
|
|
109
|
-
assert.
|
|
109
|
+
assert.strictEqual(await I.grabAttributeFrom('[name="root[custom_attributes]"]', 'custom-attribute'), 'custom-value')
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
-
Scenario('should work with cleave.js library', async (I) => {
|
|
112
|
+
Scenario('should work with cleave.js library', async ({ I }) => {
|
|
113
113
|
I.amOnPage('string-cleave.html')
|
|
114
114
|
I.seeElement('[name="root[cleave_test]"]')
|
|
115
115
|
await I.fillField('[name="root[cleave_test]"]', '12345678901234567890')
|
|
116
116
|
I.click('.get-value')
|
|
117
|
-
|
|
117
|
+
I.waitForValue('.debug', JSON.stringify({ cleave_test: '1234.567.890-1234' }))
|
|
118
118
|
})
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
|
-
|
|
5
3
|
Feature('table')
|
|
6
4
|
|
|
7
|
-
Scenario('should have correct initial value', async (I) => {
|
|
5
|
+
Scenario('should have correct initial value', async ({ I }) => {
|
|
8
6
|
I.amOnPage('table.html')
|
|
9
7
|
I.click('.get-value')
|
|
10
|
-
|
|
8
|
+
I.waitForValue('.debug', '[]')
|
|
11
9
|
})
|
|
12
10
|
|
|
13
|
-
Scenario('should ask for confirmation on node delete', async (I) => {
|
|
11
|
+
Scenario('should ask for confirmation on node delete', async ({ I }) => {
|
|
14
12
|
I.amOnPage('table.html')
|
|
15
13
|
I.click('Add Node')
|
|
16
14
|
I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
17
15
|
I.amCancellingPopups()
|
|
18
16
|
I.click('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
19
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
17
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
20
18
|
I.cancelPopup()
|
|
21
19
|
I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
22
20
|
I.amAcceptingPopups()
|
|
23
21
|
I.click('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
24
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
22
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
25
23
|
I.acceptPopup()
|
|
26
24
|
I.dontSeeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
27
25
|
})
|
|
28
26
|
|
|
29
|
-
Scenario('should ask for confirmation on node delete last', async (I) => {
|
|
27
|
+
Scenario('should ask for confirmation on node delete last', async ({ I }) => {
|
|
30
28
|
I.amOnPage('table.html')
|
|
31
29
|
I.click('Add Node')
|
|
32
30
|
I.click('Add Node')
|
|
@@ -34,19 +32,19 @@ Scenario('should ask for confirmation on node delete last', async (I) => {
|
|
|
34
32
|
I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
35
33
|
I.amCancellingPopups()
|
|
36
34
|
I.click('Delete Last Node')
|
|
37
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
35
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
38
36
|
I.cancelPopup()
|
|
39
37
|
I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
40
38
|
I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
41
39
|
I.amAcceptingPopups()
|
|
42
40
|
I.click('Delete Last Node')
|
|
43
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
41
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
44
42
|
I.acceptPopup()
|
|
45
43
|
I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
46
44
|
I.dontSeeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
47
45
|
})
|
|
48
46
|
|
|
49
|
-
Scenario('should ask for confirmation on node delete all', async (I) => {
|
|
47
|
+
Scenario('should ask for confirmation on node delete all', async ({ I }) => {
|
|
50
48
|
I.amOnPage('table.html')
|
|
51
49
|
I.click('Add Node')
|
|
52
50
|
I.click('Add Node')
|
|
@@ -54,13 +52,13 @@ Scenario('should ask for confirmation on node delete all', async (I) => {
|
|
|
54
52
|
I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
55
53
|
I.amCancellingPopups()
|
|
56
54
|
I.click('Delete All')
|
|
57
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
55
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
58
56
|
I.cancelPopup()
|
|
59
57
|
I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
60
58
|
I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
61
59
|
I.amAcceptingPopups()
|
|
62
60
|
I.click('Delete All')
|
|
63
|
-
I.seeInPopup('Are you sure you want to remove this
|
|
61
|
+
I.seeInPopup('Are you sure you want to remove this item?')
|
|
64
62
|
I.acceptPopup()
|
|
65
63
|
I.dontSeeElement('[data-schemapath="root.0"] .json-editor-btn-delete')
|
|
66
64
|
I.dontSeeElement('[data-schemapath="root.1"] .json-editor-btn-delete')
|
|
@@ -4,7 +4,7 @@ const { DEFAULT_WAIT_TIME } = require('../test-config')
|
|
|
4
4
|
|
|
5
5
|
Feature('Tabs')
|
|
6
6
|
|
|
7
|
-
Scenario('test top-tabs', (I) => {
|
|
7
|
+
Scenario('test top-tabs', ({ I }) => {
|
|
8
8
|
I.amOnPage('tabs.html')
|
|
9
9
|
I.waitForElement('[data-schemapath="root"] .json-editor-btn-add')
|
|
10
10
|
I.click('[data-schemapath="root"] .json-editor-btn-add')
|
|
@@ -4,45 +4,45 @@ const assert = require('assert')
|
|
|
4
4
|
|
|
5
5
|
Feature('uuid')
|
|
6
6
|
|
|
7
|
-
Scenario('should have initial value matching uuid @uuid', async (I) => {
|
|
7
|
+
Scenario('should have initial value matching uuid @uuid', async ({ I }) => {
|
|
8
8
|
I.amOnPage('uuid.html')
|
|
9
9
|
I.wait(1)
|
|
10
10
|
const value = await I.grabValueFrom('[name="root[uuid]"]')
|
|
11
|
-
assert.
|
|
11
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value)), true)
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
Scenario('should have initial value matching uuid in arrays @uuid', async (I) => {
|
|
14
|
+
Scenario('should have initial value matching uuid in arrays @uuid', async ({ I }) => {
|
|
15
15
|
I.click('Add uuid string array item')
|
|
16
16
|
I.click('Add uuid string array item')
|
|
17
17
|
const value0 = await I.grabValueFrom('[name="root[uuidStringArray][0]"]')
|
|
18
|
-
assert.
|
|
18
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value0)), true)
|
|
19
19
|
const value1 = await I.grabValueFrom('[name="root[uuidStringArray][1]"]')
|
|
20
|
-
assert.
|
|
20
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value1)), true)
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
Scenario('should have initial value matching uuid in arrays of objects with @uuid', async (I) => {
|
|
23
|
+
Scenario('should have initial value matching uuid in arrays of objects with @uuid', async ({ I }) => {
|
|
24
24
|
I.click('Add uuid object array item')
|
|
25
25
|
I.click('Add uuid object array item')
|
|
26
26
|
const value0 = await I.grabValueFrom('[name="root[uuidObjectArray][0][uuid]"]')
|
|
27
|
-
assert.
|
|
27
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value0)), true)
|
|
28
28
|
const value1 = await I.grabValueFrom('[name="root[uuidObjectArray][1][uuid]"]')
|
|
29
|
-
assert.
|
|
29
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value1)), true)
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
Scenario('should have initial value matching uuid in arrays (table) of strings with @uuid', async (I) => {
|
|
32
|
+
Scenario('should have initial value matching uuid in arrays (table) of strings with @uuid', async ({ I }) => {
|
|
33
33
|
I.click('Add uuid string table item')
|
|
34
34
|
I.click('Add uuid string table item')
|
|
35
35
|
const value0 = await I.grabValueFrom('[name="root[uuidStringTable][0]')
|
|
36
|
-
assert.
|
|
36
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value0)), true)
|
|
37
37
|
const value1 = await I.grabValueFrom('[name="root[uuidStringTable][1]')
|
|
38
|
-
assert.
|
|
38
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value1)), true)
|
|
39
39
|
})
|
|
40
40
|
|
|
41
|
-
Scenario('should have initial value matching uuid in arrays (table) of objects with @uuid', async (I) => {
|
|
41
|
+
Scenario('should have initial value matching uuid in arrays (table) of objects with @uuid', async ({ I }) => {
|
|
42
42
|
I.click('Add uuid object table item')
|
|
43
43
|
I.click('Add uuid object table item')
|
|
44
44
|
const value0 = await I.grabValueFrom('[name="root[uuidObjectTable][0][uuid]"]')
|
|
45
|
-
assert.
|
|
45
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value0)), true)
|
|
46
46
|
const value1 = await I.grabValueFrom('[name="root[uuidObjectTable][1][uuid]"]')
|
|
47
|
-
assert.
|
|
48
|
-
})
|
|
47
|
+
assert.strictEqual((/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value1)), true)
|
|
48
|
+
})
|
|
@@ -6,9 +6,9 @@ const { DEFAULT_WAIT_TIME } = require('../test-config')
|
|
|
6
6
|
|
|
7
7
|
Feature('Validations')
|
|
8
8
|
|
|
9
|
-
Scenario('test validations in validation.html', (I) => {
|
|
9
|
+
Scenario('test validations in validation.html', ({ I }) => {
|
|
10
10
|
I.amOnPage('validation.html')
|
|
11
|
-
|
|
11
|
+
const numberOfTestItemsExpected = 158
|
|
12
12
|
I.waitForElement('#output div:nth-child(' + numberOfTestItemsExpected + ')', DEFAULT_WAIT_TIME)
|
|
13
13
|
I.seeNumberOfElements('#output div', numberOfTestItemsExpected)
|
|
14
14
|
I.see('success')
|