diff --git a/src/schema-validation.jsonc b/src/schema-validation.jsonc index 1a645a8c425..b08782228bb 100644 --- a/src/schema-validation.jsonc +++ b/src/schema-validation.jsonc @@ -186,7 +186,6 @@ "mprocs-0.6.4.json", "nest-cli.json", "netlify.json", - "nightwatch.json", "ninjs-1.4.json", "ninjs-2.0.json", "now.json", diff --git a/src/schemas/json/nightwatch.json b/src/schemas/json/nightwatch.json index e48a29285dc..1dd80c132c5 100644 --- a/src/schemas/json/nightwatch.json +++ b/src/schemas/json/nightwatch.json @@ -1,30 +1,67 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://json.schemastore.org/nightwatch.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/nightwatch.json", "properties": { "custom_commands_path": { - "type": ["null", "string", "array"], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "Location(s) where custom commands will be loaded from.", - "items": { - "type": "string" - }, "default": null }, "custom_assertions_path": { - "type": ["null", "string", "array"], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "Location(s) where custom assertions will be loaded from.", - "items": { - "type": "string" - }, "default": null }, "page_objects_path": { - "type": ["null", "string", "array"], + "anyOf": [ + { + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "Location(s) where page object files will be loaded from.", "default": null }, "globals_path": { - "type": ["null", "string"], + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "Location of an external globals module which will be loaded and made available to the test as a property globals on the main client instance.", "default": null }, @@ -100,11 +137,21 @@ "default": "tests_output" }, "src_folders": { - "type": ["null", "string", "array"], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "A string or array of folders (excluding subfolders) where the tests are located.", - "items": { - "type": "string" - }, "default": null }, "live_output": { @@ -131,14 +178,35 @@ "default": false }, "cli_args": { - "type": ["object", "array"] + "anyOf": [ + { + "type": "array" + }, + { + "type": "object" + } + ] }, "server_path": { - "type": ["null", "string"], + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "default": null }, "log_path": { - "type": ["string", "boolean"], + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], "default": "" }, "port": {}, @@ -170,25 +238,46 @@ "description": "Skip the remaining test cases from the current test suite, when one test case fails." }, "test_workers": { - "type": ["boolean", "object"], - "description": "Whether or not to run individual test files in parallel.", - "default": false, - "properties": { - "enabled": { + "anyOf": [ + { "type": "boolean" }, - "workers": { - "type": ["string", "number"], - "description": "Automatically compute the number of workers based on CPU cores with \"auto\" or manually specify the number of workers" - }, - "node_options": { - "type": ["string", "array"], - "description": "Pass node arguments to individual workers (all of the process.execArgv using \"auto\" or selectively pass node arguments via [\"--inspect\"])", - "items": { - "type": "string" + { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "workers": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "description": "Automatically compute the number of workers based on CPU cores with \"auto\" or manually specify the number of workers" + }, + "node_options": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "description": "Pass node arguments to individual workers (all of the process.execArgv using \"auto\" or selectively pass node arguments via [\"--inspect\"])" + } } } - } + ], + "description": "Whether or not to run individual test files in parallel.", + "default": false }, "test_runner": { "type": "string", @@ -204,10 +293,24 @@ "default": false }, "cli_args": { - "type": ["object", "array"] + "anyOf": [ + { + "type": "array" + }, + { + "type": "object" + } + ] }, "server_path": { - "type": ["null", "string"], + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "default": null }, "log_path": { @@ -302,15 +405,29 @@ } }, "exclude": { - "type": ["null", "array"], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], "description": "An array of folders or file patterns to be skipped (relative to the main source folder).", - "items": { - "type": "string" - }, "default": null }, "filter": { - "type": ["null", "string"], + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "description": "Folder or file pattern to be used when loading the tests. Files that don't match this pattern will be ignored.", "default": null },