Javascript language support for testing websites, web-apps or webservices using testwizard
- import the @testwizard/test and the @testwizard/web packages
- get a session and use it to create a web testobject.
- Use this object to execute commands You can use the session to add results that will be reported to the robot when the script finishes or set results that will be posted immediately.
'use strict';
const Testwizard = require("@testwizard/test");
const Web = require("@testwizard/web");
async function test() {
const session = await Testwizard.createSession();
const website = await Web.create(session, "TestwizardWebsite");
console.log("startWebDriver");
let result = await website.startWebDriver();
console.log(result.message);
if (!result.success)
session.addFail(result.message);
if (!(session.hasFails || session.hasErrors))
session.addPass("Test was successful");
}
test();
{
"resources": [
{
"category": "WEB",
"name": "TestwizardWebsite",
"id": "Testwizard web site"
}
]
}
The version is compatible with testwizard version 3.7