Untitled
unknown
plain_text
9 months ago
2.1 kB
11
Indexable
const wdio = require('webdriverio');
const assert = require('assert');
const { byValueKey, byType } = require('appium-flutter-finder');
const { byText } = require('appium-flutter-finder');
const osSpecificOps = process.env.APPIUM_OS === 'android' ? {
'platformName': 'Android',
'appium:deviceName': 'Pixel 2',
'appium:app': __dirname + '/../apps/app-free-debug.apk',
}: process.env.APPIUM_OS === 'ios' ? {
'platformName': 'iOS',
'appium:platformVersion': '12.2',
'appium:deviceName': 'iPhone X',
'appium:noReset': true,
'appium:app': __dirname + '/../apps/Runner.zip',
} : {};
// Android
// const opts = {
// port: 4723,
// capabilities: {
// // ...osSpecificOps,
// "platformName": "android",
// // "appium:automationName": "uiautomator2",
// "appium:deviceName": "emulator-5554",
// "appium:app": "/Users/cadagmal/Documents/Development/evro-app-mobile/build/app/outputs/flutter-apk/app-dev-debug.apk",
// 'appium:automationName': 'Flutter',
// 'appium:retryBackoffTime': 500,
// "appium:autoGrantPermissions": true
// }
// };
// IOS
const opts = {
port: 4723,
capabilities: {
// ...osSpecificOps,
"platformName": "iOS",
"appium:deviceName": "iPhone 16",
"appium:app": "/Users/cadagmal/Desktop/Runner.app",
'appium:automationName': 'Flutter',
'appium:platformVersion': '18.0',
'appium:retryBackoffTime': 500,
'appium:deviceName': 'iPhone 16',
'appium:noReset': false,
"appium:bundleId": "com.evro.app.dev",
"appium:uuid": "46FEDDFC-B546-4B3D-862D-895494391AC1",
"appium:autoGrantPermissions": true
}
};
(async () => {
const driver = await wdio.remote(opts);
//Flutter Implementation
await driver.switchContext('FLUTTER');
const loginButton = byText('Sign Up with Email');
await driver.elementClick(loginButton);
// // XCUITest IOS Implementation
// await driver.switchContext('NATIVE_APP');
// const nativeSignUpButton = await driver.$('~Sign Up with Email');
// await nativeSignUpButton.click();
// driver.deleteSession();
})();
Editor is loading...
Leave a Comment