Rapi API Document (NodeJS)
Requirment
- Selenium Server (Grid) (Version recommend >= 4.8)
- Rapi-runner
- Install Rapi API
Rapi Config Document
- Before using the Rapi API, you need to know our Rapi runner config file schema. You can learn more about it here.
Quick Start
API
Rapi
createRapi(runnerPath, config)
Description
Create a rapi object by giving the executable rapi-runner path and config
Parameters
- runnerPath: The executable rapi-runner path
- config: Config create by ConfigBuilder or config file.
Example
run()
Description
The function will run the test depend on the config you set, after finish the test it will pass the report back.
Example
Config
createConfig(filePath)
Description
It will create a Config object base on the input file
Example
ConfigBuilder
The config format is define in Rapi Config File Format
setPlay(options)
Description
Set Config object's play config
Example
setTestSuites(string[])
Example
setReport(options)
Example
setWebdriveri18n(i18n)
Example
setVariables(variables)
Example
setDataDriven(dataDriven)
Example
addBrowser(serverUrl, capability)
Example
{
version: {
"sideex": [
3,
7,
3
],
"format": [
1,
0,
1
]
},
"Reports":[
{
title: "20221006 12-46-49",
sessionId: "",
type: "chrome",
browser: "chrome 103.0.5060.134",
platform: "linux",
deviceName: "unknown",
lang: null,
inputFile: "/home/fourcolor/Documents/sideex/sideex-2021/modules/main/dist/test-jobs/214e8cd6-94db-4b32-993a-8cf9af0aa04f/inputs/suites/test1.json",
startTime: "20221006 12:46:49",
endTime: "20221006 12:47:02",
failureCaseNum: 0,
failureSuiteNum: 0,
successCaseNum: 1,
successSuiteNum: 1,
logs: [
{
type: "info",
message: "Playing test suite Untitled Test Suite 2"
},
],
status: "completed",
suites: [
{
title: "Untitled Test Suite 2",
idText: "suite-20",
status: "success",
cases: [
0
]
}
],
cases: [
{
title: "Untitled Test Case 2",
idText: "case-20",
suiteIdText": "suite-20",
status: "success",
localVars: [],
globalVars: [],
records: [
{
"name": "open",
"target": "https://sideex.io/",
"value": "",
"status": "success",
"time": 4175,
"valData": []
},
{
"name": "setViewportSize",
"target": "",
"value": "1848,948",
"status": "warn",
"time": 744,
"valData": []
},
...
]
}
],
snapshot: {
"image-162": {
}
}
},
{
...
}
]
}