Я пытаюсь протестировать гибридное приложение Cordova с Appium. Я настроил среду и могу запустить тест. Но если я пытаюсь найти элемент, у меня появляется ошибка, потому что приложение запускает экран spla sh. Я использую плагин cordova-splash-screen
и скрываю его вручную в моем index.js
.
Это мой package.json
:
"appium": "appium",
"appium-doctor": "appium-doctor",
"test:android": "wdio ./config/wdio.android.conf.js",
Мой wdio.shared.conf.js
:
exports.config = {
// ====================
// Runner and framework
// Configuration
// ====================
runner: 'local',
framework: 'jasmine',
jasmineNodeOpts: {
// Updated the timeout to 30 seconds due to possible longer appium calls
// When using XPATH
defaultTimeoutInterval: 90000
},
sync: true,
logLevel: 'error',
deprecationWarnings: true,
bail: 0,
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
reporters: ['spec'],
// ====================
// Appium Configuration
// ====================
services: ['appium'],
appium: {
// For options see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
args: {
// For arguments see
// https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-appium-service
},
// Esto sirve para que coja la versión local de appium y no la global
command: 'appium'
},
port: 4723,
// ====================
// Some hooks
// ====================
beforeSession: (config, capabilities, specs) => {
require('@babel/register');
}
};
My wdio.android.conf.js
:
const {config} = require('./wdio.shared.conf');
// ============
// Specs
// ============
config.specs = [
'./test/specs/*.js'
];
// ============
// Capabilities
// ============
// For all capabilities please check
// http://appium.io/docs/en/writing-running-appium/caps/#general-capabilities
config.capabilities = [
{
// The defaults you need to have in your config
platformName: 'Android',
maxInstances: 1,
// For W3C the appium capabilities need to have an extension prefix
// http://appium.io/docs/en/writing-running-appium/caps/
// This is `appium:` for all Appium Capabilities which can be found here
deviceName: 'any',
platformVersion: '8.0',
orientation: 'PORTRAIT',
// `automationName` will be mandatory, see
// https://github.com/appium/appium/releases/tag/v1.13.0
automationName: 'appium',
appPackage: 'com.nss.ExacctaPrototype',
appActivity: '.MainActivity',
// The path to the app
app: './cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk',
// Read the reset strategies very well, they differ per platform, see
// http://appium.io/docs/en/writing-running-appium/other/reset-strategies/
noReset: true,
newCommandTimeout: 240
}
];
exports.config = config;
Я пытался настроить ожидание в wdio.shared.conf.js
, но тестовый скрипт запускается, когда spla sh все равно отображается.
Кто-нибудь решил эту проблему?