React native 如何在不使用appium构建apk的情况下测试Expo应用程序?
我试图对我的Expo应用程序进行一些测试,但我无法使用appium启动它 这是我的React native 如何在不使用appium构建apk的情况下测试Expo应用程序?,react-native,expo,appium,React Native,Expo,Appium,我试图对我的Expo应用程序进行一些测试,但我无法使用appium启动它 这是我的功能: const capabilities = { platformName: 'android', deviceName: 'Emulator1', automationName: 'UiAutomator2', pkg: 'host.exp.exponent', intentAction: 'android.intent.action.VIEW', activity: 'host.ex
功能
:
const capabilities = {
platformName: 'android',
deviceName: 'Emulator1',
automationName: 'UiAutomator2',
pkg: 'host.exp.exponent',
intentAction: 'android.intent.action.VIEW',
activity: 'host.exp.exponent.experience.HomeActivity',
appWaitForLaunch: true,
path: '/wd/',
port: 4723,
};
我明白了:
ERROR webdriver: Request failed with status 404 due to unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
[0-0] 2021-02-18T12:34:11.688Z ERROR webdriver: unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
at Object.getErrorFromResponseBody (/Users/kanka/Desktop/projects/expo-tests/node_modules/webdriver/build/utils.js:189:12)
at WebDriverRequest._request (/Users/kanka/Desktop/projects/expo-tests/node_modules/webdriver/build/request.js:168:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
[0-0] 2021-02-18T12:34:11.690Z ERROR @wdio/runner: Error: Failed to create session.
The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
at Object.startWebDriverSession (/Users/kanka/Desktop/projects/expo-tests/node_modules/webdriver/build/utils.js:68:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
2021-02-18T12:34:11.810Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in undefined - /tests/App.test.js
2021-02-18T12:34:11.811Z INFO @wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:01
如果您使用的是“webdriverio”:“^7.0.7”
软件包:请尝试按如下方式更新配置文件:
wdio.conf.js
路径
端口
不在功能
数组中。功能选项选项卡中没有路径和端口,它转到另一个选项卡谢谢!我已经设法修复我的配置,现在我无法在expo应用程序中测试我的应用程序。。。有人告诉我使用deeplink,但我不明白它是如何工作的
exports.config = {
services: ['appium'],
port: 4723,
path: '/wd/hub/',
hostname: 'localhost',
protocol: 'http',
specs: [
'./test/specs/**/*.js',
],
maxInstances: 1,
capabilities: [{
platformName: 'android',
deviceName: 'test', // Change to the name of the AVD you're using
automationName: 'UiAutomator2',
appPackage: 'host.exp.exponent',
appActivity: 'host.exp.exponent.experience.HomeActivity',
appWaitActivity: 'host.exp.exponent.experience.HomeActivity',
intentAction: 'android.intent.action.MAIN',
appWaitForLaunch: true,
newCommandTimeout: 180,
uiautomator2ServerInstallTimeout: 100000,
adbExecTimeout: 1000000,
skipLogcatCapture: true,
}],
logLevel: 'trace',
bail: 0,
waitforTimeout: 10000,
connectionRetryTimeout: 1200000,
connectionRetryCount: 3,
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 180000,
},
};