Examples
Simple example
const GptDriver = require("gpt-driver-node");
const { remote } = require("webdriverio");
const localAndroidCapabilities = {
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
};
const wdOpts = {
hostname: process.env.APPIUM_HOST || 'localhost',
port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
logLevel: 'info',
capabilities: localAndroidCapabilities,
};
const localAppiumServerUrl = 'http://127.0.0.1:4723'
const gptDriverApiKey = "..."
const testing = async () => {
const driver = await remote(wdOpts);
const gptDriver = new GptDriver({
apiKey: gptDriverApiKey,
driver,
serverConfig: {
url: localAppiumServerUrl,
}
});
await gptDriver.startSession();
await gptDriver.execute("tap on youtube")
await gptDriver.assert("the youtube app is open")
await gptDriver.stopSession("success")
}
testing();
Last updated