@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.
- package/CHANGELOG.md +18 -0
- package/README.md +47 -1
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +445 -124
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/css_integration.html +17 -15
- package/docs/custom-editor.html +92 -0
- package/docs/index.html +4 -1
- package/docs/meta_schema.json +426 -398
- package/package.json +1 -1
- package/src/defaults.js +15 -1
- package/src/editor.js +23 -6
- package/src/editors/multiple.js +64 -7
- package/src/editors/object.js +0 -1
- package/src/iconlibs/bootstrap.js +28 -0
- package/src/iconlibs/index.js +2 -0
- package/src/resolvers.js +5 -2
- package/src/schemaloader.js +3 -1
- package/src/themes/bootstrap3.js +1 -1
- package/src/utilities.js +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 +27 -27
- package/tests/codeceptjs/editors/advanced_test.js +11 -10
- package/tests/codeceptjs/editors/array_any_of_test.js +35 -35
- package/tests/codeceptjs/editors/array_test.js +757 -767
- package/tests/codeceptjs/editors/autocomplete_test.js +1 -3
- package/tests/codeceptjs/editors/button_test.js +25 -24
- package/tests/codeceptjs/editors/checkbox_test.js +17 -16
- package/tests/codeceptjs/editors/colorpicker_test.js +18 -16
- package/tests/codeceptjs/editors/datetime_test.js +7 -7
- package/tests/codeceptjs/editors/inheritance_test.js +7 -8
- package/tests/codeceptjs/editors/integer_test.js +71 -72
- package/tests/codeceptjs/editors/jodit_test.js +16 -17
- package/tests/codeceptjs/editors/multiselect_test.js +5 -5
- package/tests/codeceptjs/editors/number_test.js +64 -65
- package/tests/codeceptjs/editors/object_test.js +39 -13
- package/tests/codeceptjs/editors/option-no_default_values_test.js +4 -4
- package/tests/codeceptjs/editors/programmatic-changes_test.js +2 -3
- package/tests/codeceptjs/editors/range_test.js +1 -3
- package/tests/codeceptjs/editors/select_test.js +3 -5
- package/tests/codeceptjs/editors/stepper_test.js +5 -7
- package/tests/codeceptjs/editors/string_test.js +8 -8
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +7 -9
- package/tests/codeceptjs/editors/uuid_test.js +10 -10
- package/tests/codeceptjs/editors/validation_test.js +1 -1
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1133_test.js +1 -3
- package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +0 -2
- package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
- package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +2 -4
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
- package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
- package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
- package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
- package/tests/codeceptjs/meta-schema_test.js +10 -10
- package/tests/codeceptjs/schemaloader_test.js +7 -7
- package/tests/codeceptjs/themes_test.js +31 -0
- package/tests/pages/autocomplete.html +1 -0
- package/tests/pages/contains.html +38 -0
- package/tests/pages/dependentSchemas.html +52 -0
- package/tests/pages/if-else.html +57 -0
- package/tests/pages/if-then-else-allOf.html +117 -0
- package/tests/pages/if-then-else.html +64 -0
- package/tests/pages/if-then.html +57 -0
- package/tests/pages/issues/issue-gh-1158-2.html +189 -0
- package/tests/pages/issues/issue-gh-1165.html +63 -0
- package/tests/pages/issues/issue-gh-1165.json +8 -0
- package/tests/pages/issues/issue-gh-1211.html +1022 -0
- package/tests/pages/issues/issue-gh-1338.html +74 -0
- package/tests/pages/issues/issue-gh-1347.html +142 -0
- package/tests/pages/issues/issue-gh-795.html +58 -0
- package/tests/pages/issues/issue-gh-810.html +149 -0
- package/tests/pages/maxContains.html +39 -0
- package/tests/pages/meta-schema.html +28 -0
- package/tests/pages/meta_schema.json +426 -398
- package/tests/pages/minContains.html +39 -0
- package/tests/pages/option-dependencies.html +106 -0
- package/tests/pages/themes.html +3 -1
- package/tests/unit/core.spec.js +2 -5
- package/tests/codeceptjs/editors/issues/issue-gh-1164_test.js +0 -12
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert')
|
|
4
|
-
|
|
5
3
|
Feature('autocomplete')
|
|
6
4
|
|
|
7
5
|
Scenario('autocomplete should work @autocomplete', async ({ I }) => {
|
|
@@ -12,5 +10,5 @@ Scenario('autocomplete should work @autocomplete', async ({ I }) => {
|
|
|
12
10
|
I.waitForText('iraq', 20, '.autocomplete-result-list')
|
|
13
11
|
I.click('iraq', '.autocomplete-result:nth-child(2)')
|
|
14
12
|
I.wait(1)
|
|
15
|
-
|
|
13
|
+
I.waitForValue('.value', '"iraq"')
|
|
16
14
|
})
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
|
|
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
7
|
Scenario('should work with button editor callbacks', async ({ I }) => {
|
|
7
|
-
I.amOnPage('button-callbacks.html')
|
|
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
|
-
|
|
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
15
|
Scenario('should work with option "validated" @validated', async ({ I }) => {
|
|
15
|
-
I.amOnPage('button-callbacks.html')
|
|
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
|
-
|
|
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
27
|
Scenario('should not leave any footprints in result', async ({ I }) => {
|
|
27
|
-
I.amOnPage('button-callbacks.html')
|
|
28
|
+
I.amOnPage('button-callbacks.html')
|
|
28
29
|
I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
|
|
29
|
-
I.click('.get-value')
|
|
30
|
-
|
|
31
|
-
})
|
|
30
|
+
I.click('.get-value')
|
|
31
|
+
I.waitForValue('.value', JSON.stringify({ textinput: '' }))
|
|
32
|
+
})
|
|
32
33
|
|
|
33
34
|
Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
|
|
34
|
-
I.amOnPage('read-only.html')
|
|
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
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
|
-
|
|
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
7
|
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
|
-
})
|
|
8
|
+
I.amOnPage('read-only.html')
|
|
9
|
+
I.waitForText('READY', DEFAULT_WAIT_TIME, '.state')
|
|
10
|
+
I.seeDisabledAttribute('[name="root[checkbox]"]')
|
|
11
|
+
})
|
|
11
12
|
|
|
12
13
|
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
|
-
})
|
|
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
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const assert = require('assert')
|
|
4
|
+
|
|
5
|
+
Feature('colorpicker')
|
|
4
6
|
|
|
5
7
|
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
|
-
|
|
10
|
-
})
|
|
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
|
+
})
|
|
11
13
|
|
|
12
14
|
Scenario('test ColorPicker Editor using vanilla-picker', async ({ I }) => {
|
|
13
|
-
I.amOnPage('colorpicker-use-vanilla-picker.html')
|
|
14
|
-
I.click('.get-value')
|
|
15
|
-
|
|
16
|
-
I.click('[data-schemapath="root.colorpicker"]')
|
|
17
|
-
I.seeElement('[name="root[colorpicker]"]')
|
|
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
|
+
})
|
|
@@ -14,20 +14,20 @@ 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
|
-
|
|
17
|
+
I.waitForValue('#value', '{"time":"12:00","date":"' + today() + '","datetimelocal":"' + today() + 'T00:00' + '"}')
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
Scenario('time should have max and min attributes @datetime', async ({ I }) => {
|
|
21
|
-
assert.
|
|
22
|
-
assert.
|
|
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
25
|
Scenario('date should have max and min attributes @datetime', async ({ I }) => {
|
|
26
|
-
assert.
|
|
27
|
-
assert.
|
|
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
30
|
Scenario('datetimelocal should have max and min attributes @datetime', async ({ I }) => {
|
|
31
|
-
assert.
|
|
32
|
-
assert.
|
|
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
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
Feature('inheritance')
|
|
3
|
+
Feature('inheritance')
|
|
4
4
|
|
|
5
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
|
-
})
|
|
11
|
-
|
|
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
|
-
|
|
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
7
|
Scenario('should have correct initial value', async ({ I }) => {
|
|
7
|
-
I.amOnPage('integer.html')
|
|
8
|
-
I.click('.get-value')
|
|
9
|
-
|
|
10
|
-
})
|
|
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
13
|
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
|
-
|
|
17
|
-
range.stepUp()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
range.dispatchEvent(event)
|
|
23
|
-
})
|
|
24
|
-
I.click('.get-value')
|
|
25
|
-
|
|
26
|
-
I.executeScript(function() {
|
|
27
|
-
|
|
28
|
-
range.stepDown()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
range.dispatchEvent(event)
|
|
34
|
-
})
|
|
35
|
-
I.click('.get-value')
|
|
36
|
-
|
|
37
|
-
})
|
|
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
40
|
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
|
-
|
|
44
|
-
range.stepUp()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
range.dispatchEvent(event)
|
|
50
|
-
})
|
|
51
|
-
I.click('.get-value')
|
|
52
|
-
|
|
53
|
-
I.executeScript(function() {
|
|
54
|
-
|
|
55
|
-
range.stepDown()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
range.dispatchEvent(event)
|
|
61
|
-
})
|
|
62
|
-
I.click('.get-value')
|
|
63
|
-
|
|
64
|
-
})
|
|
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
67
|
Scenario('should be readonly if specified and not disabled', async ({ I }) => {
|
|
67
|
-
I.amOnPage('read-only.html')
|
|
68
|
-
I.seeReadOnlyAttribute('[name="root[integer]"]')
|
|
69
|
-
})
|
|
68
|
+
I.amOnPage('read-only.html')
|
|
69
|
+
I.seeReadOnlyAttribute('[name="root[integer]"]')
|
|
70
|
+
})
|
|
70
71
|
|
|
71
72
|
Scenario('should update output when (method) setValue is called', async ({ I }) => {
|
|
72
|
-
I.amOnPage('integer.html')
|
|
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
|
+
})
|
|
81
82
|
|
|
82
83
|
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
|
-
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
Feature('jodit')
|
|
3
|
+
Feature('jodit')
|
|
4
4
|
|
|
5
5
|
Scenario('should have correct initial value', async ({ I }) => {
|
|
6
|
-
I.amOnPage('string-jodit-editor.html')
|
|
7
|
-
I.click('.get-value')
|
|
8
|
-
|
|
9
|
-
})
|
|
6
|
+
I.amOnPage('string-jodit-editor.html')
|
|
7
|
+
I.click('.get-value')
|
|
8
|
+
I.waitForValue('.debug', '[]')
|
|
9
|
+
})
|
|
10
10
|
|
|
11
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')
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
/* global Feature Scenario */
|
|
2
2
|
|
|
3
|
-
Feature('multiselect')
|
|
3
|
+
Feature('multiselect')
|
|
4
4
|
|
|
5
5
|
Scenario('should be disabled if "readonly" is specified', async ({ I }) => {
|
|
6
|
-
I.amOnPage('read-only.html')
|
|
7
|
-
I.seeDisabledAttribute('[name="root[multiselect]"]')
|
|
8
|
-
})
|
|
6
|
+
I.amOnPage('read-only.html')
|
|
7
|
+
I.seeDisabledAttribute('[name="root[multiselect]"]')
|
|
8
|
+
})
|
|
@@ -1,85 +1,84 @@
|
|
|
1
1
|
/* global Feature Scenario Event */
|
|
2
2
|
|
|
3
|
-
var assert = require('assert');
|
|
4
3
|
const { DEFAULT_WAIT_TIME } = require('../test-config')
|
|
5
4
|
|
|
6
|
-
Feature('number')
|
|
5
|
+
Feature('number')
|
|
7
6
|
|
|
8
7
|
Scenario('should have correct initial value @number', async ({ I }) => {
|
|
9
|
-
I.amOnPage('number.html')
|
|
10
|
-
I.click('.get-value')
|
|
11
|
-
|
|
12
|
-
})
|
|
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
|
+
})
|
|
13
12
|
|
|
14
13
|
Scenario('should validate value @number', async ({ I }) => {
|
|
15
|
-
I.amOnPage('number.html')
|
|
16
|
-
await I.fillField('[name="root[number]"]', '12-12')
|
|
17
|
-
I.click('.get-value')
|
|
18
|
-
I.waitForText('Value must be of type number.', DEFAULT_WAIT_TIME, '[data-schemapath="root.number"] .invalid-feedback')
|
|
19
|
-
|
|
20
|
-
})
|
|
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
|
+
})
|
|
21
20
|
|
|
22
21
|
Scenario('should respect step by incrementing and decrementing the value of a @number', async ({ I }) => {
|
|
23
|
-
I.amOnPage('number.html')
|
|
24
|
-
I.seeElement('[data-schemapath="root.number_number"] input')
|
|
25
|
-
I.executeScript(function() {
|
|
26
|
-
var range = document.querySelector('[data-schemapath="root.number_number"] input')
|
|
27
|
-
range.stepUp()
|
|
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()
|
|
28
27
|
var event = new Event('change', {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
range.dispatchEvent(event)
|
|
33
|
-
})
|
|
34
|
-
I.click('.get-value')
|
|
35
|
-
|
|
36
|
-
I.executeScript(function() {
|
|
37
|
-
var range = document.querySelector('[data-schemapath="root.number_number"] input')
|
|
38
|
-
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()
|
|
39
38
|
var event = new Event('change', {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
range.dispatchEvent(event)
|
|
44
|
-
})
|
|
45
|
-
I.click('.get-value')
|
|
46
|
-
|
|
47
|
-
})
|
|
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
|
+
})
|
|
48
47
|
|
|
49
48
|
Scenario('should respect step by incrementing and decrementing the value of a range @number', async ({ I }) => {
|
|
50
|
-
I.amOnPage('number.html')
|
|
51
|
-
I.seeElement('[data-schemapath="root.number_range"] input')
|
|
52
|
-
I.executeScript(function() {
|
|
53
|
-
var range = document.querySelector('[data-schemapath="root.number_range"] input')
|
|
54
|
-
range.stepUp()
|
|
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()
|
|
55
54
|
var event = new Event('change', {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
59
|
-
range.dispatchEvent(event)
|
|
60
|
-
})
|
|
61
|
-
I.click('.get-value')
|
|
62
|
-
|
|
63
|
-
I.executeScript(function() {
|
|
64
|
-
var range = document.querySelector('[data-schemapath="root.number_range"] input')
|
|
65
|
-
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()
|
|
66
65
|
var event = new Event('change', {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
range.dispatchEvent(event)
|
|
71
|
-
})
|
|
72
|
-
I.click('.get-value')
|
|
73
|
-
|
|
74
|
-
})
|
|
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
|
+
})
|
|
75
74
|
|
|
76
75
|
Scenario('should be readonly if specified and not disabled @number', async ({ I }) => {
|
|
77
|
-
I.amOnPage('read-only.html')
|
|
78
|
-
I.seeReadOnlyAttribute('[name="root[number]"]')
|
|
79
|
-
})
|
|
76
|
+
I.amOnPage('read-only.html')
|
|
77
|
+
I.seeReadOnlyAttribute('[name="root[number]"]')
|
|
78
|
+
})
|
|
80
79
|
|
|
81
80
|
Scenario('should update output when setValue is called @number', async ({ I }) => {
|
|
82
|
-
I.amOnPage('number.html')
|
|
83
|
-
I.click('.set-value')
|
|
84
|
-
I.see('2', '[data-schemapath="root.number_range"] output')
|
|
85
|
-
})
|
|
81
|
+
I.amOnPage('number.html')
|
|
82
|
+
I.click('.set-value')
|
|
83
|
+
I.see('2', '[data-schemapath="root.number_range"] output')
|
|
84
|
+
})
|