Commit d2f37999 authored by Jérome Perrin's avatar Jérome Perrin

software/jstestnode: move selenium configuration in test-runner key

Also fix JSON schema, that was just invalid.

Now we have a schema that renders properly on
https://lab.nexedi.com/bk/rjs_json_form and is similar to the one from
erp5, so maybe one day we can have a convention on erp5 testnode to push
the URL of a selenium server as test-runner.server-url . In any case,
it's good for now to have consistency.

Most of this work comes from Boris Kocherov from https://www.raskon.org/
Thanks !
parent 9e4c6f8d
......@@ -27,4 +27,4 @@ md5sum = 9f22db89a2679534aa8fd37dbca86782
[template-runTestSuite]
filename = runTestSuite.in
md5sum = bd9ff3543f0dfaf2702624e3ed74d334
md5sum = a9d5633df2bcbe86529bd8399f7f84c8
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Parameters to instantiate JSTestNode",
"additionalProperties": false,
"required": [
"test-suite",
"test-runner"
],
"properties": {
"test-suite": {
"description": "The test suite to run",
......@@ -18,68 +22,86 @@
"default": "(the web server started by this instance)",
"example": "https://softinst1234.host.vifib.net/"
},
"oneOf": [
{
"title": "selenium server",
"description": "Configuration for running tests on selenium server",
"properties": {
"target": {
"description": "Target system",
"const": "selenium-server"
},
"server-url": {
"description": "URL of the selenium server",
"type": "string"
},
"verify-server-certificate": {
"description": "Verify the SSL/TLS Certificats of the selenium server when using HTTPS",
"type": "boolean",
"default": true
},
"server-ca-certificate": {
"description": "PEM encoded bundle of CA Certificates to verify the SSL/TLS Certificate of the selenium server when using HTTPS",
"type": "string",
"default": "root certificates from http://certifi.io/en/latest/"
},
"desired-capabilities": {
"description": "Desired browser capabilities",
"type": "object",
"properties": {
"browserName": {
"description": "Name of the browser being used, for example firefox, chrome",
"type": "string",
"required": true
},
"version": {
"description": "The browser version",
"type": "string"
}
"test-runner": {
"oneOf": [
{
"type": "object",
"title": "Selenium Server",
"description": "Configuration for Selenium server",
"additionalProperties": false,
"required": [
"desired-capabilities",
"server-url",
"target"
],
"properties": {
"target": {
"description": "Target system",
"type": "string",
"const": "selenium-server"
},
"server-url": {
"description": "URL of the selenium server",
"type": "string",
"format": "uri"
},
"verify-server-certificate": {
"description": "Verify the SSL/TLS Certificats of the selenium server when using HTTPS",
"type": "boolean",
"default": true
},
"server-ca-certificate": {
"description": "PEM encoded bundle of CA Certificates to verify the SSL/TLS Certificate of the selenium server when using HTTPS",
"type": "string",
"default": "root certificates from http://certifi.io/en/latest/"
},
"additionalProperties": true
"desired-capabilities": {
"description": "Desired browser capabilities",
"required": [
"browserName"
],
"type": "object",
"properties": {
"browserName": {
"description": "Name of the browser being used, for example firefox, chrome",
"type": "string"
},
"version": {
"description": "The browser version",
"type": "string"
}
}
}
}
}
},
{
"title": "firefox",
"description": "Configuration for running tests on local firefox process",
"properties": {
"target": {
"description": "Target system",
"const": "firefox",
"default": "firefox"
},
{
"type": "object",
"title": "Firefox",
"description": "Configuration for Firefox",
"additionalProperties": false,
"properties": {
"target": {
"description": "Target system",
"const": "firefox",
"type": "string",
"default": "firefox"
}
}
}
},
{
"title": "node",
"description": "Configuration for running tests on local nodejs",
"properties": {
"target": {
"description": "Target system",
"const": "node"
},
{
"type": "object",
"title": "NodeJS",
"description": "Configuration for NodeJS",
"additionalProperties": false,
"properties": {
"target": {
"description": "Target system",
"const": "node",
"type": "string"
}
}
}
}
]
]
}
}
}
......@@ -41,7 +41,7 @@ def main():
args = parser.parse_args()
parsed_parameters = json.load(
open('$${runTestSuite-config-file:rendered}', 'rb'))
open('$${runTestSuite-config-file:rendered}', 'rb')).get('test-runner', {})
is_browser_running = False
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment