Reference

aiExecute

Will execute a given natural language instruction. Please refer to our Prompt Guide for best practices.

// simple instructions
gptDriver.aiExecute("tap on the login button");

// more abstract instructions
gptDriver.aiExecute("Navigate to the settings screen");

// complex instructions
gptDriver.aiExecute("Check that you see a list of hotel room options, if so tap on the cheapest room option");

assert

Verify something without taking any action. The function will pass or throw an error

gptDriver.assert(`The total price is ${price}`);

assertBulk

Check multiple conditions are met in one go. The function will throw an error if any of the assertions is not true.

gptDriver.assertBulk([
    `The total price is ${price}`,
    "The VAT is calculated correctly",
    "The delivery date is shown in the format dd.mm.YYYY"
]);

checkBulk

Check multiple conditions are met in one go. The function will return a object with true and false values for each conditions.

const checkResults = gptDriver.checkBulk([
    `The total price is ${price}`,
    "The VAT is calculated correctly",
    "The delivery date is shown in the format dd.mm.YYYY"
]);

extract

Extract information from current screen. Returns an object with the extracted values.

// Example to extract flight information from a screen.
const flightInformation = gptDriver.extract([
    "departureAirportCode",
    "destinationAirportCode",
    "departureTime",
    "destinationTime",
    "travelTime"
]);

// Which can later be used in assertions.
gptDriver.assertBulk([
    `departure airport is ${flightInformation['departureAirportCode']}`,
    `destination airport is ${flightInformation['destinationAirportCode']}`
]);

Last updated