Repeato allows you to execute scripts via so-called “Script steps”.
Here is the full JavaScript API:
General Variables | |
---|---|
data | object which you can use to share data between your steps. |
currentStepIndex | step index of the currently executing step |
testRunDir | actual directory of the current test run |
testDir | actual directory of the current test |
General Methods | |
---|---|
log(message) | log message or object |
await sleep(x) | delay for x milliseconds |
await getResponse(host, path, headers) | sends a GET request |
await sendPost(host, path, body, acceptHeader, headers) | sends a POST request |
TestRunner Properties and Methods | |
---|---|
testRunner.currentTest | access all properties of the current test. Use log(testRunner.currentTest) to print all properties of the test object |
testRunner.getTestRun() | access all properties of the current test run. Use log(testRunner.getTestRun()) to print all properties of the test run object |
testRunner.lastStepResult | returns the result of the previously executed step. You can try log(testRunner.lastStepResult) to see which properties there are… |
testRunner.currentStepIndex | a index which represents the index of the current step (starting from 0) |
testRunner.deviceConnector | direct access to methods which allow you to send commands to the device. See properties and methods list below… |
testRunner.setNextStepIndex(index) | set the next step number which should be executed by the test runner (starting from 0) |
testRunner.setNextStepId(id) | set the next step which should be executed after this one by using it’s ID |
testRunner.goBackBy(stepCount) | test runner will go back by [stepCount] steps and continue to execute from there |
DeviceConnector Properties and Methods | |
---|---|
testRunner.deviceConnector.selectedDeviceData | all data related to the currently connected device. Use log(testRunner.deviceConnector.selectedDeviceData) to get a picture of what’s available |
testRunner.deviceConnector.sendString(string) | sends a string to the device. The app under test must have an input field to receive the data and the field must be focused. |
testRunner.deviceConnector.sendClick(xPerc, yPerc) | send a touch event to the device. Internally sendClick sends a sendDown followed by a sendUp. xPerc and yPerc are relative coordinates between 0 and 1. sendClick(0.5,0.5) will send a click in the very center of the screen. |
testRunner.deviceConnector.sendDown(xPerc, yPerc) | send a touch event to the device. Each sendDown needs a sendUp. Usually sendDown is used with sendMove to simulate a drag guesture |
testRunner.deviceConnector.sendMove(xPerc, yPerc) | send a “move finger” event to the device. Use sendDown before sendMove to simulate a drag. Finish your drag with sendUp |
testRunner.deviceConnector.sendUp(xPerc, yPerc) | send a “lift finger” event to the device. |
Please fill out the form below to begin the download