@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.
Files changed (106) hide show
  1. package/.github/workflows/build.yml +2 -0
  2. package/CHANGELOG.md +29 -7
  3. package/README.md +47 -1
  4. package/config/codeceptjs_helpers.js +4 -8
  5. package/config/karma.conf.js +0 -4
  6. package/config/webpack.common.js +1 -1
  7. package/config/webpack.dev.js +1 -1
  8. package/config/webpack.nonmin.js +1 -1
  9. package/config/webpack.prod.js +0 -1
  10. package/dist/dev/jsoneditor.js +3687 -0
  11. package/dist/jsoneditor.js +2 -14
  12. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  13. package/dist/jsoneditor.js.map +1 -1
  14. package/dist/nonmin/jsoneditor.js +25744 -26450
  15. package/dist/nonmin/jsoneditor.js.map +1 -1
  16. package/docs/css_integration.html +17 -15
  17. package/docs/custom-editor.html +92 -0
  18. package/docs/datetime.html +37 -2
  19. package/docs/index.html +4 -1
  20. package/docs/meta_schema.json +426 -398
  21. package/package.json +26 -24
  22. package/src/defaults.js +15 -1
  23. package/src/editor.js +23 -6
  24. package/src/editors/integer.js +5 -3
  25. package/src/editors/multiple.js +67 -8
  26. package/src/editors/number.js +5 -3
  27. package/src/editors/object.js +0 -1
  28. package/src/editors/radio.js +4 -6
  29. package/src/editors/select.js +0 -6
  30. package/src/iconlibs/bootstrap.js +28 -0
  31. package/src/iconlibs/index.js +2 -0
  32. package/src/resolvers.js +5 -2
  33. package/src/schemaloader.js +3 -1
  34. package/src/themes/bootstrap3.js +1 -1
  35. package/src/utilities.js +22 -0
  36. package/src/validator.js +93 -0
  37. package/tests/codeceptjs/constrains/contains_test.js +36 -0
  38. package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
  39. package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
  40. package/tests/codeceptjs/core_test.js +46 -46
  41. package/tests/codeceptjs/editors/advanced_test.js +12 -11
  42. package/tests/codeceptjs/editors/array_any_of_test.js +37 -37
  43. package/tests/codeceptjs/editors/array_test.js +784 -794
  44. package/tests/codeceptjs/editors/autocomplete_test.js +4 -6
  45. package/tests/codeceptjs/editors/button_test.js +30 -29
  46. package/tests/codeceptjs/editors/checkbox_test.js +19 -18
  47. package/tests/codeceptjs/editors/colorpicker_test.js +20 -18
  48. package/tests/codeceptjs/editors/datetime_test.js +11 -11
  49. package/tests/codeceptjs/editors/inheritance_test.js +8 -9
  50. package/tests/codeceptjs/editors/integer_test.js +77 -78
  51. package/tests/codeceptjs/editors/jodit_test.js +18 -19
  52. package/tests/codeceptjs/editors/multiselect_test.js +6 -6
  53. package/tests/codeceptjs/editors/number_test.js +72 -71
  54. package/tests/codeceptjs/editors/object_test.js +52 -26
  55. package/tests/codeceptjs/editors/option-no_default_values_test.js +6 -6
  56. package/tests/codeceptjs/editors/programmatic-changes_test.js +4 -5
  57. package/tests/codeceptjs/editors/radio_test.js +1 -1
  58. package/tests/codeceptjs/editors/range_test.js +2 -4
  59. package/tests/codeceptjs/editors/rating_test.js +1 -1
  60. package/tests/codeceptjs/editors/select_test.js +5 -7
  61. package/tests/codeceptjs/editors/stepper_test.js +8 -10
  62. package/tests/codeceptjs/editors/string_test.js +16 -16
  63. package/tests/codeceptjs/editors/table-confirm-delete_test.js +11 -13
  64. package/tests/codeceptjs/editors/tabs_test.js +1 -1
  65. package/tests/codeceptjs/editors/uuid_test.js +15 -15
  66. package/tests/codeceptjs/editors/validation_test.js +2 -2
  67. package/tests/codeceptjs/issues/issue-gh-1133_test.js +9 -0
  68. package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
  69. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +1 -3
  70. package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
  71. package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
  72. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +3 -5
  73. package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
  74. package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
  75. package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
  76. package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
  77. package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
  78. package/tests/codeceptjs/meta-schema_test.js +12 -12
  79. package/tests/codeceptjs/schemaloader_test.js +8 -8
  80. package/tests/codeceptjs/themes_test.js +40 -9
  81. package/tests/pages/autocomplete.html +1 -0
  82. package/tests/pages/contains.html +38 -0
  83. package/tests/pages/dependentSchemas.html +52 -0
  84. package/tests/pages/if-else.html +57 -0
  85. package/tests/pages/if-then-else-allOf.html +117 -0
  86. package/tests/pages/if-then-else.html +64 -0
  87. package/tests/pages/if-then.html +57 -0
  88. package/tests/pages/issues/issue-gh-1133.html +64 -0
  89. package/tests/pages/issues/issue-gh-1158-2.html +189 -0
  90. package/tests/pages/issues/issue-gh-1164.html +71 -0
  91. package/tests/pages/issues/issue-gh-1165.html +63 -0
  92. package/tests/pages/issues/issue-gh-1165.json +8 -0
  93. package/tests/pages/issues/issue-gh-1211.html +1022 -0
  94. package/tests/pages/issues/issue-gh-1338.html +74 -0
  95. package/tests/pages/issues/issue-gh-1347.html +142 -0
  96. package/tests/pages/issues/issue-gh-795.html +58 -0
  97. package/tests/pages/issues/issue-gh-810.html +149 -0
  98. package/tests/pages/maxContains.html +39 -0
  99. package/tests/pages/meta-schema.html +28 -0
  100. package/tests/pages/meta_schema.json +426 -398
  101. package/tests/pages/minContains.html +39 -0
  102. package/tests/pages/number.html +18 -0
  103. package/tests/pages/option-dependencies.html +106 -0
  104. package/tests/pages/themes.html +3 -1
  105. package/tests/unit/core.spec.js +8 -10
  106. package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
@@ -1,16 +1,14 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- var assert = require('assert')
4
-
5
3
  Feature('autocomplete')
6
4
 
7
- Scenario('autocomplete should work @autocomplete', async (I) => {
5
+ Scenario('autocomplete should work @autocomplete', async ({ I }) => {
8
6
  I.amOnPage('autocomplete.html')
9
7
  I.waitForElement('.je-ready', 10)
10
8
  I.fillField('root', 'ir')
11
- I.waitForText('iran', 10, '.autocomplete-result-list')
12
- I.waitForText('iraq', 10, '.autocomplete-result-list')
9
+ I.waitForText('iran', 20, '.autocomplete-result-list')
10
+ I.waitForText('iraq', 20, '.autocomplete-result-list')
13
11
  I.click('iraq', '.autocomplete-result:nth-child(2)')
14
12
  I.wait(1)
15
- assert.equal(await I.grabValueFrom('.value'), '"iraq"')
13
+ I.waitForValue('.value', '"iraq"')
16
14
  })
@@ -1,43 +1,44 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('../test-config')
3
4
 
4
- Feature('button');
5
+ Feature('button')
5
6
 
6
- Scenario('should work with button editor callbacks', async (I) => {
7
- I.amOnPage('button-callbacks.html');
7
+ Scenario('should work with button editor callbacks', async ({ I }) => {
8
+ I.amOnPage('button-callbacks.html')
8
9
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
9
- I.seeElement('[data-schemapath="root.button1"] button');
10
- I.click('[data-schemapath="root.button1"] button');
11
- assert.equal(await I.grabValueFrom('.value'), 'button1CB');
12
- });
10
+ I.seeElement('[data-schemapath="root.button1"] button')
11
+ I.click('[data-schemapath="root.button1"] button')
12
+ I.waitForValue('.value', 'button1CB')
13
+ })
13
14
 
14
- Scenario('should work with option "validated"', async (I) => {
15
- I.amOnPage('button-callbacks.html');
15
+ Scenario('should work with option "validated" @validated', async ({ I }) => {
16
+ I.amOnPage('button-callbacks.html')
16
17
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
17
- I.seeElement('[data-schemapath="root.button1"] button');
18
- I.retry({ retries: 3, minTimeout: 500 }).seeDisabledAttribute('[data-schemapath="root.button2"] button');
19
- await I.fillField('[name="root[textinput]"]', 'Hello World');
20
- I.pressKey('Tab');
21
- I.dontSeeDisabledAttribute('[data-schemapath="root.button2"] button');
22
- I.click('[data-schemapath="root.button2"] button');
23
- assert.equal(await I.grabValueFrom('.value'), 'button2CB');
24
- });
18
+ I.seeElement('[data-schemapath="root.button1"] button')
19
+ I.retry({ retries: 3, minTimeout: 500 }).seeDisabledAttribute('[data-schemapath="root.button2"] button')
20
+ await I.fillField('[name="root[textinput]"]', 'Hello World')
21
+ I.pressKey('Tab')
22
+ I.dontSeeDisabledAttribute('[data-schemapath="root.button2"] button')
23
+ I.click('[data-schemapath="root.button2"] button')
24
+ I.waitForValue('.value', 'button2CB')
25
+ })
25
26
 
26
- Scenario('should not leave any footprints in result', async (I) => {
27
- I.amOnPage('button-callbacks.html');
27
+ Scenario('should not leave any footprints in result', async ({ I }) => {
28
+ I.amOnPage('button-callbacks.html')
28
29
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
29
- I.click('.get-value');
30
- assert.equal(await I.grabValueFrom('.value'), JSON.stringify({"textinput":""}));
31
- });
30
+ I.click('.get-value')
31
+ I.waitForValue('.value', JSON.stringify({ textinput: '' }))
32
+ })
32
33
 
33
- Scenario('should be disabled if "readonly" is specified', async (I) => {
34
- I.amOnPage('read-only.html');
34
+ Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
35
+ I.amOnPage('read-only.html')
35
36
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
36
- I.seeDisabledAttribute('[data-schemapath="root.button"] button');
37
- });
37
+ I.seeDisabledAttribute('[data-schemapath="root.button"] button')
38
+ })
38
39
 
39
- Scenario('should set icon @button @button-icon', async (I) => {
40
+ Scenario('should set icon @button @button-icon', async ({ I }) => {
40
41
  I.amOnPage('button-icons.html')
41
42
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
42
43
  I.waitForElement('i.fas.fa-search', DEFAULT_WAIT_TIME)
43
- });
44
+ })
@@ -1,22 +1,23 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('../test-config')
3
4
 
4
- Feature('checkbox');
5
+ Feature('checkbox')
5
6
 
6
- Scenario('should be disabled if "readonly" is specified', async (I) => {
7
- I.amOnPage('read-only.html');
8
- I.waitForText('READY', DEFAULT_WAIT_TIME, '.state');
9
- I.seeDisabledAttribute('[name="root[checkbox]"]');
10
- });
7
+ Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
8
+ I.amOnPage('read-only.html')
9
+ I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
10
+ I.seeDisabledAttribute('[name="root[checkbox]"]')
11
+ })
11
12
 
12
- Scenario('label should be visible for items at top level, but not in tables', async (I) => {
13
- I.amOnPage('checkbox-labels.html');
14
- I.waitForText('READY', DEFAULT_WAIT_TIME, '.state');
15
- I.seeElement('//label[contains(@for, "root[Awesome Compact]")]');
16
- I.seeElement('//label[contains(@for, "root[Awesome Not Compact]")]');
17
- I.dontSeeElement('//label[contains(@for, "root[pets][0][Awesome in Object Table]")]');
18
- I.dontSeeElement('//label[contains(@for, "root[pets][1][Awesome in Object Table]")]');
19
- I.dontSeeElement('//label[contains(@for, "root[pets][2][Awesome in Object Table]")]');
20
- I.dontSeeElement('//label[contains(@for, "root[pets][3][Awesome in Object Table]")]');
21
- I.dontSeeElement('//label[contains(@for, "root[pets][4][Awesome in Object Table]")]');
22
- });
13
+ Scenario('label should be visible for items at top level, but not in tables', async ({ I }) => {
14
+ I.amOnPage('checkbox-labels.html')
15
+ I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
16
+ I.seeElement('//label[contains(@for, "root[Awesome Compact]")]')
17
+ I.seeElement('//label[contains(@for, "root[Awesome Not Compact]")]')
18
+ I.dontSeeElement('//label[contains(@for, "root[pets][0][Awesome in Object Table]")]')
19
+ I.dontSeeElement('//label[contains(@for, "root[pets][1][Awesome in Object Table]")]')
20
+ I.dontSeeElement('//label[contains(@for, "root[pets][2][Awesome in Object Table]")]')
21
+ I.dontSeeElement('//label[contains(@for, "root[pets][3][Awesome in Object Table]")]')
22
+ I.dontSeeElement('//label[contains(@for, "root[pets][4][Awesome in Object Table]")]')
23
+ })
@@ -1,27 +1,29 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
2
 
3
- Feature('colorpicker');
3
+ const assert = require('assert')
4
4
 
5
- Scenario('test ColorPicker Editor without third party library', async (I) => {
6
- I.amOnPage('colorpicker-no-3rd-party.html');
7
- I.seeElement('[name="root[colorpicker]');
8
- I.click('.get-value');
9
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({"colorpicker":"#efefef"}));
10
- });
5
+ Feature('colorpicker')
11
6
 
12
- Scenario('test ColorPicker Editor using vanilla-picker', async (I) => {
13
- I.amOnPage('colorpicker-use-vanilla-picker.html');
14
- I.click('.get-value');
15
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify({"colorpicker":"rgba(0,0,0,1)"}));
16
- I.click('[data-schemapath="root.colorpicker"]');
17
- I.seeElement('[name="root[colorpicker]"]');
7
+ Scenario('test ColorPicker Editor without third party library', async ({ I }) => {
8
+ I.amOnPage('colorpicker-no-3rd-party.html')
9
+ I.seeElement('[name="root[colorpicker]')
10
+ I.click('.get-value')
11
+ I.waitForValue('.debug', JSON.stringify({ colorpicker: '#efefef' }))
12
+ })
13
+
14
+ Scenario('test ColorPicker Editor using vanilla-picker', async ({ I }) => {
15
+ I.amOnPage('colorpicker-use-vanilla-picker.html')
16
+ I.click('.get-value')
17
+ I.waitForValue('.debug', JSON.stringify({ colorpicker: 'rgba(0,0,0,1)' }))
18
+ I.click('[data-schemapath="root.colorpicker"]')
19
+ I.seeElement('[name="root[colorpicker]"]')
18
20
  await I.dragAndDrop('[data-schemapath="root.colorpicker"] .picker_wrapper .picker_sl .picker_selector', '[data-schemapath="root.colorpicker"] .picker_wrapper .picker_sl')
19
21
  await I.dragAndDrop('[data-schemapath="root.colorpicker"] .picker_wrapper .picker_hue .picker_selector', '[data-schemapath="root.colorpicker"] .picker_wrapper .picker_hue')
20
22
  await I.dragAndDrop('[data-schemapath="root.colorpicker"] .picker_wrapper .picker_alpha .picker_selector', '[data-schemapath="root.colorpicker"] .picker_wrapper .picker_alpha')
21
23
  I.click('.picker_done button')
22
24
  // I.click('.get-value');
23
- I.click('.get-value');
25
+ I.click('.get-value')
24
26
  const color = await I.grabValueFrom('.debug')
25
- const reg = /\{"colorpicker":"rgba\(6\d,19\d,19\d,0.5\d*\)"\}/;
26
- assert.ok(reg.test(color), color + ' match ' + reg);
27
- });
27
+ const reg = /\{"colorpicker":"rgba\(6\d,19\d,19\d,0.5\d*\)"\}/
28
+ assert.ok(reg.test(color), color + ' match ' + reg)
29
+ })
@@ -10,24 +10,24 @@ const today = (offset) => {
10
10
 
11
11
  Feature('datetime')
12
12
 
13
- Scenario('should have correct initial value @datetime', async (I) => {
13
+ Scenario('should have correct initial value @datetime', async ({ I }) => {
14
14
  I.amOnPage('datetime.html')
15
15
  I.wait(1)
16
16
  I.click('#get-value')
17
- assert.equal(await I.grabValueFrom('#value'), '{"time":"12:00","date":"' + today() + '","datetimelocal":"' + today() + 'T00:00' + '"}')
17
+ I.waitForValue('#value', '{"time":"12:00","date":"' + today() + '","datetimelocal":"' + today() + 'T00:00' + '"}')
18
18
  })
19
19
 
20
- Scenario('time should have max and min attributes @datetime', async (I) => {
21
- assert.equal(await I.grabAttributeFrom('[name="root[time]"]', 'min'), '11:00')
22
- assert.equal(await I.grabAttributeFrom('[name="root[time]"]', 'max'), '13:00')
20
+ Scenario('time should have max and min attributes @datetime', async ({ I }) => {
21
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[time]"]', 'min'), '11:00')
22
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[time]"]', 'max'), '13:00')
23
23
  })
24
24
 
25
- Scenario('date should have max and min attributes @datetime', async (I) => {
26
- assert.equal(await I.grabAttributeFrom('[name="root[date]"]', 'min'), '1970-01-01')
27
- assert.equal(await I.grabAttributeFrom('[name="root[date]"]', 'max'), '2100-01-01')
25
+ Scenario('date should have max and min attributes @datetime', async ({ I }) => {
26
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[date]"]', 'min'), '1970-01-01')
27
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[date]"]', 'max'), '2100-01-01')
28
28
  })
29
29
 
30
- Scenario('datetimelocal should have max and min attributes @datetime', async (I) => {
31
- assert.equal(await I.grabAttributeFrom('[name="root[datetimelocal]"]', 'min'), '1970-01-01T00:00')
32
- assert.equal(await I.grabAttributeFrom('[name="root[datetimelocal]"]', 'max'), '2100-01-01T00:00')
30
+ Scenario('datetimelocal should have max and min attributes @datetime', async ({ I }) => {
31
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[datetimelocal]"]', 'min'), '1970-01-01T00:00')
32
+ assert.strictEqual(await I.grabAttributeFrom('[name="root[datetimelocal]"]', 'max'), '2100-01-01T00:00')
33
33
  })
@@ -1,11 +1,10 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
2
 
3
- Feature('inheritance');
4
-
5
- Scenario('should display all required fields in the allOf hierarchy', async (I) => {
6
- I.amOnPage('inheritance.html');
7
- I.seeElement('[data-schemapath="root.breed"]');
8
- I.seeElement('[data-schemapath="root.numLegs"]');
9
- I.seeElement('[data-schemapath="root.id"]');
10
- });
3
+ Feature('inheritance')
11
4
 
5
+ Scenario('should display all required fields in the allOf hierarchy', async ({ I }) => {
6
+ I.amOnPage('inheritance.html')
7
+ I.seeElement('[data-schemapath="root.breed"]')
8
+ I.seeElement('[data-schemapath="root.numLegs"]')
9
+ I.seeElement('[data-schemapath="root.id"]')
10
+ })
@@ -1,90 +1,89 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario Event */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('../test-config')
3
4
 
4
- Feature('integer');
5
+ Feature('integer')
5
6
 
6
- Scenario('should have correct initial value', async (I) => {
7
- I.amOnPage('integer.html');
8
- I.click('.get-value');
9
- assert.equal(await I.grabValueFrom('.value'), '{"integer":5,"integer_number":5,"integer_range":5}');
10
- });
7
+ Scenario('should have correct initial value', async ({ I }) => {
8
+ I.amOnPage('integer.html')
9
+ I.click('.get-value')
10
+ I.waitForValue('.value', '{"integer":5,"integer_number":5,"integer_range":5}')
11
+ })
11
12
 
12
- Scenario('should respect step by incrementing and decrementing the value of a number', async (I) => {
13
- I.amOnPage('integer.html');
14
- I.seeElement('[data-schemapath="root.integer"] input');
15
- I.executeScript(function() {
16
- var range = document.querySelector('[data-schemapath="root.integer_number"] input');
17
- range.stepUp();
18
- var event = new Event('change', {
19
- 'bubbles': true,
20
- 'cancelable': true
21
- });
22
- range.dispatchEvent(event);
23
- });
24
- I.click('.get-value');
25
- assert.equal(await I.grabValueFrom('.value'), '{"integer":5,"integer_number":10,"integer_range":5}');
26
- I.executeScript(function() {
27
- var range = document.querySelector('[data-schemapath="root.integer_number"] input');
28
- range.stepDown();
29
- var event = new Event('change', {
30
- 'bubbles': true,
31
- 'cancelable': true
32
- });
33
- range.dispatchEvent(event);
34
- });
35
- I.click('.get-value');
36
- assert.equal(await I.grabValueFrom('.value'), '{"integer":5,"integer_number":5,"integer_range":5}');
37
- });
13
+ Scenario('should respect step by incrementing and decrementing the value of a number', async ({ I }) => {
14
+ I.amOnPage('integer.html')
15
+ I.seeElement('[data-schemapath="root.integer"] input')
16
+ I.executeScript(function () {
17
+ const range = document.querySelector('[data-schemapath="root.integer_number"] input')
18
+ range.stepUp()
19
+ const event = new Event('change', {
20
+ bubbles: true,
21
+ cancelable: true
22
+ })
23
+ range.dispatchEvent(event)
24
+ })
25
+ I.click('.get-value')
26
+ I.waitForValue('.value', '{"integer":5,"integer_number":10,"integer_range":5}')
27
+ I.executeScript(function () {
28
+ const range = document.querySelector('[data-schemapath="root.integer_number"] input')
29
+ range.stepDown()
30
+ const event = new Event('change', {
31
+ bubbles: true,
32
+ cancelable: true
33
+ })
34
+ range.dispatchEvent(event)
35
+ })
36
+ I.click('.get-value')
37
+ I.waitForValue('.value', '{"integer":5,"integer_number":5,"integer_range":5}')
38
+ })
38
39
 
39
- Scenario('should respect step by incrementing and decrementing the value of a range', async (I) => {
40
- I.amOnPage('integer.html');
41
- I.seeElement('[data-schemapath="root.integer_range"] input');
42
- I.executeScript(function() {
43
- var range = document.querySelector('[data-schemapath="root.integer_range"] input');
44
- range.stepUp();
45
- var event = new Event('change', {
46
- 'bubbles': true,
47
- 'cancelable': true
48
- });
49
- range.dispatchEvent(event);
50
- });
51
- I.click('.get-value');
52
- assert.equal(await I.grabValueFrom('.value'), '{"integer":5,"integer_number":5,"integer_range":10}');
53
- I.executeScript(function() {
54
- var range = document.querySelector('[data-schemapath="root.integer_range"] input');
55
- range.stepDown();
56
- var event = new Event('change', {
57
- 'bubbles': true,
58
- 'cancelable': true
59
- });
60
- range.dispatchEvent(event);
61
- });
62
- I.click('.get-value');
63
- assert.equal(await I.grabValueFrom('.value'), '{"integer":5,"integer_number":5,"integer_range":5}');
64
- });
40
+ Scenario('should respect step by incrementing and decrementing the value of a range', async ({ I }) => {
41
+ I.amOnPage('integer.html')
42
+ I.seeElement('[data-schemapath="root.integer_range"] input')
43
+ I.executeScript(function () {
44
+ const range = document.querySelector('[data-schemapath="root.integer_range"] input')
45
+ range.stepUp()
46
+ const event = new Event('change', {
47
+ bubbles: true,
48
+ cancelable: true
49
+ })
50
+ range.dispatchEvent(event)
51
+ })
52
+ I.click('.get-value')
53
+ I.waitForValue('.value', '{"integer":5,"integer_number":5,"integer_range":10}')
54
+ I.executeScript(function () {
55
+ const range = document.querySelector('[data-schemapath="root.integer_range"] input')
56
+ range.stepDown()
57
+ const event = new Event('change', {
58
+ bubbles: true,
59
+ cancelable: true
60
+ })
61
+ range.dispatchEvent(event)
62
+ })
63
+ I.click('.get-value')
64
+ I.waitForValue('.value', '{"integer":5,"integer_number":5,"integer_range":5}')
65
+ })
65
66
 
66
- Scenario('should be readonly if specified and not disabled', async (I) => {
67
- I.amOnPage('read-only.html');
68
- I.seeReadOnlyAttribute('[name="root[integer]"]');
69
- });
67
+ Scenario('should be readonly if specified and not disabled', async ({ I }) => {
68
+ I.amOnPage('read-only.html')
69
+ I.seeReadOnlyAttribute('[name="root[integer]"]')
70
+ })
70
71
 
71
- Scenario('should update output when (method) setValue is called', async (I) => {
72
- I.amOnPage('integer.html');
72
+ Scenario('should update output when (method) setValue is called', async ({ I }) => {
73
+ I.amOnPage('integer.html')
73
74
  I.saveScreenshot('integer-setvalue-1.png')
74
- I.waitForText('5', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output');
75
+ I.waitForText('5', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output')
75
76
  I.saveScreenshot('integer-setvalue-2.png')
76
- I.click('.set-value');
77
+ I.click('.set-value')
77
78
  I.saveScreenshot('integer-setvalue-3.png')
78
- I.waitForText('2', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output');
79
+ I.waitForText('2', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output')
79
80
  I.saveScreenshot('integer-setvalue-4.png')
80
- });
81
-
82
- Scenario('should validate value', async (I) => {
83
- I.amOnPage('integer.html');
84
- await I.fillField('[name="root[integer]"]', '5-5');
85
- I.click('.get-value');
86
- I.see('Value must be of type integer.', '[data-schemapath="root.integer"] div');
87
- assert.equal(await I.grabValueFrom('.value'), '{"integer":"5-5","integer_number":5,"integer_range":5}');
88
- });
89
-
81
+ })
90
82
 
83
+ Scenario('should validate value', async ({ I }) => {
84
+ I.amOnPage('integer.html')
85
+ await I.fillField('[name="root[integer]"]', '5-5')
86
+ I.click('.get-value')
87
+ I.see('Value must be of type integer.', '[data-schemapath="root.integer"] div')
88
+ I.waitForValue('.value', '{"integer":"5-5","integer_number":5,"integer_range":5}')
89
+ })
@@ -1,24 +1,23 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
2
 
3
- Feature('jodit');
3
+ Feature('jodit')
4
4
 
5
- Scenario('should have correct initial value', async (I) => {
6
- I.amOnPage('string-jodit-editor.html');
7
- I.click('.get-value');
8
- assert.equal(await I.grabValueFrom('.debug'), '[]');
9
- });
5
+ Scenario('should have correct initial value', async ({ I }) => {
6
+ I.amOnPage('string-jodit-editor.html')
7
+ I.click('.get-value')
8
+ I.waitForValue('.debug', '[]')
9
+ })
10
10
 
11
- Scenario('should have coerent values', async (I) => {
12
- I.amOnPage('string-jodit-editor.html');
13
- I.click('Add item');
14
- I.see('item 1');
15
- I.seeElement('.jodit-wysiwyg_mode');
11
+ Scenario('should have coerent values', async ({ I }) => {
12
+ I.amOnPage('string-jodit-editor.html')
13
+ I.click('Add item')
14
+ I.see('item 1')
15
+ I.seeElement('.jodit-wysiwyg_mode')
16
16
 
17
- I.click('.jodit-toolbar-button_bold button');
18
- I.pressKeys('__JODIT__');
19
- I.see('__JODIT__');
17
+ I.click('.jodit-toolbar-button_bold button')
18
+ I.pressKeys('__JODIT__')
19
+ I.see('__JODIT__')
20
20
 
21
- I.click('.get-value');
22
- assert.equal(await I.grabValueFrom('.debug'), JSON.stringify([{"editor":"<p><strong>__JODIT__</strong><br></p>"}]));
23
-
24
- });
21
+ I.click('.get-value')
22
+ I.waitForValue('.debug', JSON.stringify([{ editor: '<p><strong>__JODIT__</strong><br></p>' }]))
23
+ })
@@ -1,8 +1,8 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
2
 
3
- Feature('multiselect');
3
+ Feature('multiselect')
4
4
 
5
- Scenario('should be disabled if "readonly" is specified', async (I) => {
6
- I.amOnPage('read-only.html');
7
- I.seeDisabledAttribute('[name="root[multiselect]"]');
8
- });
5
+ Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
6
+ I.amOnPage('read-only.html')
7
+ I.seeDisabledAttribute('[name="root[multiselect]"]')
8
+ })
@@ -1,83 +1,84 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario Event */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('../test-config')
3
4
 
4
- Feature('number');
5
+ Feature('number')
5
6
 
6
- Scenario('should have correct initial value', async (I) => {
7
- I.amOnPage('number.html');
8
- I.click('.get-value');
9
- assert.equal(await I.grabValueFrom('.value'), '{"number":5.75,"number_number":5.75,"number_range":5.75}');
10
- });
7
+ Scenario('should have correct initial value @number', async ({ I }) => {
8
+ I.amOnPage('number.html')
9
+ I.click('.get-value')
10
+ I.waitForValue('.value', '{"number":5.75,"number_number":5.75,"number_range":5.75,"stepper_number_default":5,"stepper_integer_default":5}')
11
+ })
11
12
 
12
- Scenario('should validate value', async (I) => {
13
- I.amOnPage('number.html');
14
- await I.fillField('[name="root[number]"]', '12-12');
15
- I.click('.get-value');
16
- I.waitForText('Value must be of type number.', DEFAULT_WAIT_TIME, '[data-schemapath="root.number"] .invalid-feedback');
17
- assert.equal(await I.grabValueFrom('.value'), '{"number":"12-12","number_number":5.75,"number_range":5.75}');
18
- });
13
+ Scenario('should validate value @number', async ({ I }) => {
14
+ I.amOnPage('number.html')
15
+ await I.fillField('[name="root[number]"]', '12-12')
16
+ I.click('.get-value')
17
+ I.waitForText('Value must be of type number.', DEFAULT_WAIT_TIME, '[data-schemapath="root.number"] .invalid-feedback')
18
+ I.waitForValue('.value', '{"number":"12-12","number_number":5.75,"number_range":5.75,"stepper_number_default":5,"stepper_integer_default":5}')
19
+ })
19
20
 
20
- Scenario('should respect step by incrementing and decrementing the value of a number', async (I) => {
21
- I.amOnPage('number.html');
22
- I.seeElement('[data-schemapath="root.number_number"] input');
23
- I.executeScript(function() {
24
- var range = document.querySelector('[data-schemapath="root.number_number"] input');
25
- range.stepUp();
21
+ Scenario('should respect step by incrementing and decrementing the value of a @number', async ({ I }) => {
22
+ I.amOnPage('number.html')
23
+ I.seeElement('[data-schemapath="root.number_number"] input')
24
+ I.executeScript(function () {
25
+ var range = document.querySelector('[data-schemapath="root.number_number"] input')
26
+ range.stepUp()
26
27
  var event = new Event('change', {
27
- 'bubbles': true,
28
- 'cancelable': true
29
- });
30
- range.dispatchEvent(event);
31
- });
32
- I.click('.get-value');
33
- assert.equal(await I.grabValueFrom('.value'), '{"number":5.75,"number_number":6,"number_range":5.75}');
34
- I.executeScript(function() {
35
- var range = document.querySelector('[data-schemapath="root.number_number"] input');
36
- range.stepDown();
28
+ bubbles: true,
29
+ cancelable: true
30
+ })
31
+ range.dispatchEvent(event)
32
+ })
33
+ I.click('.get-value')
34
+ I.waitForValue('.value', '{"number":5.75,"number_number":6,"number_range":5.75,"stepper_number_default":5,"stepper_integer_default":5}')
35
+ I.executeScript(function () {
36
+ var range = document.querySelector('[data-schemapath="root.number_number"] input')
37
+ range.stepDown()
37
38
  var event = new Event('change', {
38
- 'bubbles': true,
39
- 'cancelable': true
40
- });
41
- range.dispatchEvent(event);
42
- });
43
- I.click('.get-value');
44
- assert.equal(await I.grabValueFrom('.value'), '{"number":5.75,"number_number":5.75,"number_range":5.75}');
45
- });
39
+ bubbles: true,
40
+ cancelable: true
41
+ })
42
+ range.dispatchEvent(event)
43
+ })
44
+ I.click('.get-value')
45
+ I.waitForValue('.value', '{"number":5.75,"number_number":5.75,"number_range":5.75,"stepper_number_default":5,"stepper_integer_default":5}')
46
+ })
46
47
 
47
- Scenario('should respect step by incrementing and decrementing the value of a range', async (I) => {
48
- I.amOnPage('number.html');
49
- I.seeElement('[data-schemapath="root.number_range"] input');
50
- I.executeScript(function() {
51
- var range = document.querySelector('[data-schemapath="root.number_range"] input');
52
- range.stepUp();
48
+ Scenario('should respect step by incrementing and decrementing the value of a range @number', async ({ I }) => {
49
+ I.amOnPage('number.html')
50
+ I.seeElement('[data-schemapath="root.number_range"] input')
51
+ I.executeScript(function () {
52
+ var range = document.querySelector('[data-schemapath="root.number_range"] input')
53
+ range.stepUp()
53
54
  var event = new Event('change', {
54
- 'bubbles': true,
55
- 'cancelable': true
56
- });
57
- range.dispatchEvent(event);
58
- });
59
- I.click('.get-value');
60
- assert.equal(await I.grabValueFrom('.value'), '{"number":5.75,"number_number":5.75,"number_range":6}');
61
- I.executeScript(function() {
62
- var range = document.querySelector('[data-schemapath="root.number_range"] input');
63
- range.stepDown();
55
+ bubbles: true,
56
+ cancelable: true
57
+ })
58
+ range.dispatchEvent(event)
59
+ })
60
+ I.click('.get-value')
61
+ I.waitForValue('.value', '{"number":5.75,"number_number":5.75,"number_range":6,"stepper_number_default":5,"stepper_integer_default":5}')
62
+ I.executeScript(function () {
63
+ var range = document.querySelector('[data-schemapath="root.number_range"] input')
64
+ range.stepDown()
64
65
  var event = new Event('change', {
65
- 'bubbles': true,
66
- 'cancelable': true
67
- });
68
- range.dispatchEvent(event);
69
- });
70
- I.click('.get-value');
71
- assert.equal(await I.grabValueFrom('.value'), '{"number":5.75,"number_number":5.75,"number_range":5.75}');
72
- });
66
+ bubbles: true,
67
+ cancelable: true
68
+ })
69
+ range.dispatchEvent(event)
70
+ })
71
+ I.click('.get-value')
72
+ I.waitForValue('.value', '{"number":5.75,"number_number":5.75,"number_range":5.75,"stepper_number_default":5,"stepper_integer_default":5}')
73
+ })
73
74
 
74
- Scenario('should be readonly if specified and not disabled', async (I) => {
75
- I.amOnPage('read-only.html');
76
- I.seeReadOnlyAttribute('[name="root[number]"]');
77
- });
75
+ Scenario('should be readonly if specified and not disabled @number', async ({ I }) => {
76
+ I.amOnPage('read-only.html')
77
+ I.seeReadOnlyAttribute('[name="root[number]"]')
78
+ })
78
79
 
79
- Scenario('should update output when setValue is called', async (I) => {
80
- I.amOnPage('number.html');
81
- I.click('.set-value');
82
- I.see('2', '[data-schemapath="root.number_range"] output');
83
- });
80
+ Scenario('should update output when setValue is called @number', async ({ I }) => {
81
+ I.amOnPage('number.html')
82
+ I.click('.set-value')
83
+ I.see('2', '[data-schemapath="root.number_range"] output')
84
+ })