@json-editor/json-editor 2.9.1 → 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.
Files changed (87) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +47 -1
  3. package/dist/jsoneditor.js +1 -1
  4. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  5. package/dist/nonmin/jsoneditor.js +445 -124
  6. package/dist/nonmin/jsoneditor.js.map +1 -1
  7. package/docs/css_integration.html +17 -15
  8. package/docs/custom-editor.html +92 -0
  9. package/docs/index.html +4 -1
  10. package/docs/meta_schema.json +426 -398
  11. package/package.json +1 -1
  12. package/src/defaults.js +15 -1
  13. package/src/editor.js +23 -6
  14. package/src/editors/multiple.js +64 -7
  15. package/src/editors/object.js +0 -1
  16. package/src/iconlibs/bootstrap.js +28 -0
  17. package/src/iconlibs/index.js +2 -0
  18. package/src/resolvers.js +5 -2
  19. package/src/schemaloader.js +3 -1
  20. package/src/themes/bootstrap3.js +1 -1
  21. package/src/utilities.js +22 -0
  22. package/src/validator.js +93 -0
  23. package/tests/codeceptjs/constrains/contains_test.js +36 -0
  24. package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
  25. package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
  26. package/tests/codeceptjs/core_test.js +27 -27
  27. package/tests/codeceptjs/editors/advanced_test.js +11 -10
  28. package/tests/codeceptjs/editors/array_any_of_test.js +35 -35
  29. package/tests/codeceptjs/editors/array_test.js +757 -767
  30. package/tests/codeceptjs/editors/autocomplete_test.js +1 -3
  31. package/tests/codeceptjs/editors/button_test.js +25 -24
  32. package/tests/codeceptjs/editors/checkbox_test.js +17 -16
  33. package/tests/codeceptjs/editors/colorpicker_test.js +18 -16
  34. package/tests/codeceptjs/editors/datetime_test.js +7 -7
  35. package/tests/codeceptjs/editors/inheritance_test.js +7 -8
  36. package/tests/codeceptjs/editors/integer_test.js +71 -72
  37. package/tests/codeceptjs/editors/jodit_test.js +16 -17
  38. package/tests/codeceptjs/editors/multiselect_test.js +5 -5
  39. package/tests/codeceptjs/editors/number_test.js +64 -65
  40. package/tests/codeceptjs/editors/object_test.js +39 -13
  41. package/tests/codeceptjs/editors/option-no_default_values_test.js +4 -4
  42. package/tests/codeceptjs/editors/programmatic-changes_test.js +2 -3
  43. package/tests/codeceptjs/editors/range_test.js +1 -3
  44. package/tests/codeceptjs/editors/select_test.js +3 -5
  45. package/tests/codeceptjs/editors/stepper_test.js +5 -7
  46. package/tests/codeceptjs/editors/string_test.js +8 -8
  47. package/tests/codeceptjs/editors/table-confirm-delete_test.js +7 -9
  48. package/tests/codeceptjs/editors/uuid_test.js +10 -10
  49. package/tests/codeceptjs/editors/validation_test.js +1 -1
  50. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1133_test.js +1 -3
  51. package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
  52. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +0 -2
  53. package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
  54. package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
  55. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +2 -4
  56. package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
  57. package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
  58. package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
  59. package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
  60. package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
  61. package/tests/codeceptjs/meta-schema_test.js +10 -10
  62. package/tests/codeceptjs/schemaloader_test.js +7 -7
  63. package/tests/codeceptjs/themes_test.js +31 -0
  64. package/tests/pages/autocomplete.html +1 -0
  65. package/tests/pages/contains.html +38 -0
  66. package/tests/pages/dependentSchemas.html +52 -0
  67. package/tests/pages/if-else.html +57 -0
  68. package/tests/pages/if-then-else-allOf.html +117 -0
  69. package/tests/pages/if-then-else.html +64 -0
  70. package/tests/pages/if-then.html +57 -0
  71. package/tests/pages/issues/issue-gh-1158-2.html +189 -0
  72. package/tests/pages/issues/issue-gh-1165.html +63 -0
  73. package/tests/pages/issues/issue-gh-1165.json +8 -0
  74. package/tests/pages/issues/issue-gh-1211.html +1022 -0
  75. package/tests/pages/issues/issue-gh-1338.html +74 -0
  76. package/tests/pages/issues/issue-gh-1347.html +142 -0
  77. package/tests/pages/issues/issue-gh-795.html +58 -0
  78. package/tests/pages/issues/issue-gh-810.html +149 -0
  79. package/tests/pages/maxContains.html +39 -0
  80. package/tests/pages/meta-schema.html +28 -0
  81. package/tests/pages/meta_schema.json +426 -398
  82. package/tests/pages/minContains.html +39 -0
  83. package/tests/pages/option-dependencies.html +106 -0
  84. package/tests/pages/themes.html +3 -1
  85. package/tests/unit/core.spec.js +2 -5
  86. package/tests/codeceptjs/editors/issues/issue-gh-1164_test.js +0 -12
  87. package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
@@ -7,11 +7,11 @@ Feature('object')
7
7
 
8
8
  Scenario('should respect property orders', async ({ I }) => {
9
9
  I.amOnPage('object.html')
10
- assert.equal(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(1) [data-schemapath^="root."]', 'data-schemapath'), 'root.age')
11
- assert.equal(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(2) [data-schemapath^="root."]', 'data-schemapath'), 'root.name')
12
- assert.equal(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(3) [data-schemapath^="root."]', 'data-schemapath'), 'root.single')
13
- assert.equal(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(4) [data-schemapath^="root."]', 'data-schemapath'), 'root.values')
14
- assert.equal(await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(5) [data-schemapath^="root."]', 'data-schemapath'), 'root.zodiac')
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
17
  Scenario('should validate required properties', async ({ I }) => {
@@ -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
- assert.equal(await I.grabValueFrom('.value'), '{"number":0,"boolean":false}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"number":0,"boolean":false}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"string":"","number":0,"boolean":false,"radio":"Home"}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"string":"","number":0,"boolean":false,"radio":"Home","array":[]}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"string":"","number":0,"boolean":false,"radio":"Home","array":[],"object":{"string":"","array":[]}}')
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')
@@ -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
- assert.equal(await I.grabValueFrom('.value'), '{"string":"test","number":0,"boolean":false,"array":["test"],"object":{"string":"","number":10,"boolean":true,"array":[]}}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"number":0,"boolean":false}')
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)
@@ -216,7 +216,7 @@ Scenario('objects should contain properties defined with the properties keyword
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
- assert.equal(await I.grabValueFrom('.value'), '{"aptrue":{"name":"Albert","age":0},"apfalse":{"name":"Albert"}}')
219
+ I.waitForValue('.value', '{"aptrue":{"name":"Albert","age":0},"apfalse":{"name":"Albert"}}')
220
220
  })
221
221
 
222
222
  Scenario('should have unique ids', ({ I }) => {
@@ -244,6 +244,32 @@ 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 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
+
247
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)
@@ -1,11 +1,11 @@
1
- var assert = require('assert')
1
+ /* global Feature Scenario */
2
2
 
3
3
  Feature('option no_default_values')
4
4
 
5
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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({
8
+ I.waitForValue('.debug', JSON.stringify({
9
9
  integer: undefined,
10
10
  number: undefined,
11
11
  string: undefined
@@ -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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({
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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({
37
+ I.waitForValue('.debug', JSON.stringify({
38
38
  number: undefined,
39
39
  string: '',
40
40
  integer: undefined
@@ -1,6 +1,5 @@
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')
@@ -9,7 +8,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
- assert.equal(await I.grabValueFrom('.value'), '{"boolean":false,"boolean_checkbox":false,"string":"","integer":0,"number":0,"array":[],"array_checkbox":[],"array_select":[]}')
11
+ I.waitForValue('.value', '{"boolean":false,"boolean_checkbox":false,"string":"","integer":0,"number":0,"array":[],"array_checkbox":[],"array_select":[]}')
13
12
  })
14
13
 
15
14
  Scenario('should have correct values after setting them programmatically', async ({ I }) => {
@@ -17,5 +16,5 @@ Scenario('should have correct values after setting them programmatically', async
17
16
  I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
18
17
  I.click('.set-values')
19
18
  I.click('.get-value')
20
- assert.equal(await I.grabValueFrom('.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]}')
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
5
  Scenario('should have and display initial value @range', async ({ I }) => {
8
6
  I.amOnPage('range.html')
9
7
  I.click('.get-value')
10
- assert.equal(await I.grabValueFrom('.value'), '{"speed":1}')
8
+ I.waitForValue('.value', '{"speed":1}')
11
9
  I.waitForText('1', 5, 'output')
12
10
  })
@@ -1,19 +1,17 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- var assert = require('assert')
4
-
5
3
  Feature('select')
6
4
 
7
5
  Scenario('should return correct booleans values when selected', async ({ I }) => {
8
6
  I.amOnPage('select.html')
9
7
  I.click('.get-value')
10
- assert.equal(await I.grabValueFrom('.value'), '{"boolean":true}')
8
+ I.waitForValue('.value', '{"boolean":true}')
11
9
  I.selectOption('[name="root[boolean]"]', 'false')
12
10
  I.click('.get-value')
13
- assert.equal(await I.grabValueFrom('.value'), '{"boolean":false}')
11
+ I.waitForValue('.value', '{"boolean":false}')
14
12
  I.selectOption('[name="root[boolean]"]', 'true')
15
13
  I.click('.get-value')
16
- assert.equal(await I.grabValueFrom('.value'), '{"boolean":true}')
14
+ I.waitForValue('.value', '{"boolean":true}')
17
15
  })
18
16
 
19
17
  Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
@@ -1,14 +1,12 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- var assert = require('assert')
4
-
5
3
  Feature('stepper')
6
4
 
7
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
- assert.equal(await I.grabValueFrom('.value'), '{}')
9
+ I.waitForValue('.value', '{}')
12
10
  })
13
11
 
14
12
  Scenario('should be constrained to maximun and minimun values when stepped @stepper', async ({ I }) => {
@@ -18,12 +16,12 @@ Scenario('should be constrained to maximun and minimun values when stepped @step
18
16
  I.click('.stepper-up')
19
17
  I.click('.get-value')
20
18
  I.click('.get-value')
21
- assert.equal(await I.grabValueFrom('.value'), '{"stepper":6}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"stepper":5}')
24
+ I.waitForValue('.value', '{"stepper":5}')
27
25
  })
28
26
 
29
27
  Scenario('should be correct initialized when manually set @stepper', async ({ I }) => {
@@ -31,9 +29,9 @@ Scenario('should be correct initialized when manually set @stepper', async ({ I
31
29
  I.fillField('[name="root[stepper]"]', 10)
32
30
  I.click('.stepper-up')
33
31
  I.click('.get-value')
34
- assert.equal(await I.grabValueFrom('.value'), '{"stepper":11}')
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
- assert.equal(await I.grabValueFrom('.value'), '{"stepper":9}')
36
+ I.waitForValue('.value', '{"stepper":9}')
39
37
  })
@@ -7,7 +7,7 @@ Feature('string')
7
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
- assert.equal(await I.grabValueFrom('.debug'), '[]')
10
+ I.waitForValue('.debug', '[]')
11
11
  })
12
12
 
13
13
  Scenario('should have coerent values', async ({ I }) => {
@@ -21,13 +21,13 @@ Scenario('should have coerent values', async ({ I }) => {
21
21
  I.see('__YELLOW__')
22
22
 
23
23
  I.click('.get-value')
24
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify([{ editor: '__YELLOW__' }]))
24
+ I.waitForValue('.debug', JSON.stringify([{ editor: '__YELLOW__' }]))
25
25
  })
26
26
 
27
27
  Scenario('sceditor should have correct initial value', async ({ I }) => {
28
28
  I.amOnPage('string-sceditor.html')
29
29
  I.click('.get-value')
30
- assert.equal(await I.grabValueFrom('.debug'), '[]')
30
+ I.waitForValue('.debug', '[]')
31
31
  })
32
32
 
33
33
  Scenario('editor value and String editor should have coerent values @optional', async ({ I }) => {
@@ -43,7 +43,7 @@ Scenario('editor value and String editor should have coerent values @optional',
43
43
  I.switchTo()
44
44
 
45
45
  I.click('.get-value')
46
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify([{ editor: '<p>__YELLOW__</p>' }]))
46
+ I.waitForValue('.debug', JSON.stringify([{ editor: '<p>__YELLOW__</p>' }]))
47
47
  })
48
48
 
49
49
  Scenario('Should work correctly in arrays @optional', async ({ I }) => {
@@ -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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify([{ editor: '<p>__YELLOW__<br></p>' }, { editor: '<p>__BLUE__<br></p>' }]))
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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify([{ editor: '<p>__BLUE__<br></p>' }, { editor: '<p>__YELLOW__<br></p>' }]))
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
 
@@ -106,7 +106,7 @@ Scenario('should be readonly if specified and not disabled', async ({ I }) => {
106
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.equal(await I.grabAttributeFrom('[name="root[custom_attributes]"]', 'custom-attribute'), 'custom-value')
109
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[custom_attributes]"]', 'custom-attribute'), 'custom-value')
110
110
  })
111
111
 
112
112
  Scenario('should work with cleave.js library', async ({ I }) => {
@@ -114,5 +114,5 @@ Scenario('should work with cleave.js library', async ({ I }) => {
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
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({ cleave_test: '1234.567.890-1234' }))
117
+ I.waitForValue('.debug', JSON.stringify({ cleave_test: '1234.567.890-1234' }))
118
118
  })
@@ -1,13 +1,11 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- var assert = require('assert')
4
-
5
3
  Feature('table')
6
4
 
7
5
  Scenario('should have correct initial value', async ({ I }) => {
8
6
  I.amOnPage('table.html')
9
7
  I.click('.get-value')
10
- assert.equal(await I.grabValueFrom('.debug'), '[]')
8
+ I.waitForValue('.debug', '[]')
11
9
  })
12
10
 
13
11
  Scenario('should ask for confirmation on node delete', async ({ I }) => {
@@ -16,12 +14,12 @@ Scenario('should ask for confirmation on node delete', async ({ I }) => {
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 node?')
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 node?')
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
  })
@@ -34,13 +32,13 @@ 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 node?')
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 node?')
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')
@@ -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 node?')
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 node?')
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')
@@ -8,41 +8,41 @@ 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.equal((/^[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)
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
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.equal((/^[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)
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.equal((/^[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)
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
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.equal((/^[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)
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.equal((/^[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)
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
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.equal((/^[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)
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.equal((/^[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)
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
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.equal((/^[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)
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.equal((/^[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
- })
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
+ })
@@ -8,7 +8,7 @@ Feature('Validations')
8
8
 
9
9
  Scenario('test validations in validation.html', ({ I }) => {
10
10
  I.amOnPage('validation.html')
11
- var numberOfTestItemsExpected = 158
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')
@@ -1,11 +1,9 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- const assert = require('assert')
4
-
5
3
  Feature('GitHub issue 1133')
6
4
 
7
5
  Scenario('GitHub issue 1133 should remain fixed @issue-1133', async ({ I }) => {
8
6
  I.amOnPage('issues/issue-gh-1133.html')
9
7
  I.waitForElement('.je-ready')
10
- assert.equal(await I.grabValueFrom('#value'), '{"SaveDataMask":"DP"}')
8
+ I.waitForValue('#value', '{"SaveDataMask":"DP"}')
11
9
  })
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1165 should remain fixed @issue-1165 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1165.html')
7
+ I.waitForText('Add item')
8
+ I.click('Add item')
9
+ I.waitForText('external-schema')
10
+ })
@@ -1,7 +1,5 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- const assert = require('assert')
4
-
5
3
  Feature('issues')
6
4
 
7
5
  Scenario('GitHub issue 1158 should remain fixed @issue-1158 @optional', async ({ I }) => {
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('GitHub issue 1164')
4
+
5
+ Scenario('GitHub issue 1164 should remain fixed @issue-1164', ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1164.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForInvisible('option[value="undefined"]')
9
+ I.waitForValue('#value', '{"arrayEnumSelect":["one"],"stringEnumRadio":"one","numberEnumRadio":1.1,"integerEnumRadio":1}')
10
+ })
@@ -0,0 +1,17 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1211 should remain fixed @issue-1211 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1211.html')
7
+ I.waitForText('Rule collection')
8
+ I.waitForText('SSID & MAC Groups')
9
+ I.waitForText('Certificate Extensions')
10
+ I.click('Rule')
11
+ I.waitForText('Generic Allow Rule')
12
+ I.click('Group')
13
+ I.waitForText('Group 1')
14
+ I.click('Extension')
15
+ I.waitForText('OID')
16
+ I.waitForValue('#value', '{"rules":[{"type":"any","name":"","description":"","enabled":false}],"groups":[{"type":"ssid-group","ssid-group":[],"name":"","description":""}],"certificate-extensions":[{"name":"","oid":""}],"trustedroots":[],"intuneids":[]}')
17
+ })
@@ -1,13 +1,11 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- const assert = require('assert')
4
-
5
3
  Feature('GitHub issue 1257')
6
4
 
7
5
  Scenario('GitHub issue 1257 should remain fixed @issue-1257', async ({ I }) => {
8
6
  I.amOnPage('issues/issue-gh-1257.html')
9
7
  I.waitForElement('.je-ready')
10
8
  I.click('[data-schemapath="root.colors"] .json-editor-btntype-add')
11
- assert.equal(await I.grabValueFrom('#value'), '{"colors":[{"text":"X","color":"#fefaac"}],"color":"#fefaac"}')
12
- assert.equal(await I.grabValueFrom('[name="root[colors][0][color]"]'), '#fefaac')
9
+ I.waitForValue('#value', '{"colors":[{"text":"X","color":"#fefaac"}],"color":"#fefaac"}')
10
+ I.waitForValue('[name="root[colors][0][color]"]', '#fefaac')
13
11
  })
@@ -0,0 +1,16 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1338 should remain fixed @issue-1338', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1338.html')
7
+ I.waitForText('Value required')
8
+ I.fillField('[id="root[field_a]"]', 'test')
9
+ I.pressKey('Tab')
10
+ I.dontSee('Value required')
11
+ I.refreshPage()
12
+ I.waitForText('Value required')
13
+ I.fillField('[id="root[field_b]"]', 'test')
14
+ I.pressKey('Tab')
15
+ I.dontSee('Value required')
16
+ })
@@ -0,0 +1,8 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1347 should remain fixed @issue-1347', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1347.html')
7
+ I.waitForValue('#value', '{"caplzsone":[{"dateField1":"","amountField1":"","amountField2":"","amountField3":"","amountField4":""}],"caplzszero":[{"dateField1":"","amountField1":"9999","amountField2":"2222","amountField3":"3333","amountField4":"4444"},{"dateField1":"","amountField1":"6666","amountField2":"7777","amountField3":"8888","amountField4":"9999"}]}')
8
+ })
@@ -0,0 +1,13 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 795 should remain fixed @issue-795 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-795.html')
7
+ I.waitForText('Add item')
8
+ I.click('Add item')
9
+ I.waitForText('box')
10
+ I.fillField('#value', JSON.stringify([[{}], {}]))
11
+ I.click('Set Value')
12
+ I.waitForValue('#value', '[[{}],{}]')
13
+ })
@@ -0,0 +1,52 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 810 should remain fixed @issue-810', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-810.html')
7
+ I.waitForText('I changed 1 times')
8
+ I.fillField('#value', JSON.stringify({
9
+ name: 'Jeremy Dorn',
10
+ age: 25,
11
+ favorite_color: '#ffa500',
12
+ gender: 'male',
13
+ date: '',
14
+ location: {
15
+ city: 'San Francisco',
16
+ state: 'CA',
17
+ citystate: 'San Francisco, CA'
18
+ },
19
+ pets: [
20
+ {
21
+ type: 'dog',
22
+ name: 'Walter'
23
+ },
24
+ {
25
+ type: 'dog',
26
+ name: 'Walter2'
27
+ }
28
+ ]
29
+ }))
30
+ I.click('#set-value')
31
+ I.waitForText('I changed 2 times')
32
+ I.fillField('#value', JSON.stringify({
33
+ name: 'Jeremy Dorn',
34
+ age: 25,
35
+ favorite_color: '#ffa500',
36
+ gender: 'male',
37
+ date: '',
38
+ location: {
39
+ city: 'San Francisco',
40
+ state: 'CA',
41
+ citystate: 'San Francisco, CA'
42
+ },
43
+ pets: [
44
+ {
45
+ type: 'dog',
46
+ name: 'Walter'
47
+ }
48
+ ]
49
+ }))
50
+ I.click('#set-value')
51
+ I.waitForText('I changed 3 times')
52
+ })