描述
排毒测试挂在Android模拟器上的init
调用上。该应用程序安装在模拟器上,但从未启动。相同的测试在iOS模拟器上的相同应用程序上执行。我正在使用Cucumber
作为测试运行器,我只是在init
挂钩中调用BeforeAll
函数。
hooks.js
const {Before, BeforeAll, AfterAll} = require('cucumber');
const detox = require('detox');
const detoxConfig = require('../../../package.json').detox;
BeforeAll({timeout: 60 * 1000}, async () => {
await detox.init(detoxConfig);
});
的package.json
"detox": {
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Pixel_2",
"session": {
"server": "ws://localhost:8099",
"sessionId": "androidDebug"
}
}
}
}
排毒,节点,设备和macOS版本
排毒:7.3.3
节点:8.9.4
模拟器:Android Studio默认w / API 24(7.0)
macOS:High Sierra版本10.13.3
React-Native:0.55.2
反应:16.0.0
排毒服务器日志
MBP-55EE:detox-android$ detox run-server
detox-server info 12:14:32: server listening on localhost:8099...
detox-server wss 12:14:48: role=tester login (sessionId=androidDebug)
detox-server wss 12:14:48: role=tester action=loginSuccess
(sessionId=androidDebug)
detox-server wss 12:14:53: role=tester action=isReady
(sessionId=androidDebug)
detox-server wss 12:14:53: role=testee not connected, cannot fw action
(sessionId=androidDebug)
detox-server wss 12:15:48: role=tester disconnect
(sessionId=androidDebug)
对我而言,在测试完成的过程中,对我来说有什么帮助,但我仍然看到测试人员没有连接的线路,所以我不知所措。
除此之外的所有内容都在XCode 9中的iOS模拟器上运行
MBP-55EE:detox-android$ detox run-server
detox-server info 10:53:28: server listening on localhost:8099...
detox-server wss 10:54:27: role=tester login (sessionId=debugSession)
detox-server wss 10:54:27: role=tester action=loginSuccess
(sessionId=debugSession)
detox-server wss 10:54:44: role=tester action=isReady
(sessionId=debugSession)
detox-server wss 10:54:44: role=testee not connected, cannot fw action
(sessionId=debugSession)
detox-server wss 10:54:49: role=testee login (sessionId=debugSession)
detox-server wss 10:54:49: role=testee action=loginSuccess
(sessionId=debugSession)
detox-server wss 10:54:49: role=testee action=ready
(sessionId=debugSession)
detox-server wss 10:54:49: role=tester action=invoke
(sessionId=debugSession)
detox-server wss 10:54:49: role=testee action=invokeResult
(sessionId=debugSession)
detox-server wss 10:54:49: role=tester action=invoke
(sessionId=debugSession)
detox-server wss 10:54:50: role=testee action=invokeResult
(sessionId=debugSession)
detox-server wss 10:54:50: role=tester action=invoke
(sessionId=debugSession)
detox-server wss 10:54:50: role=testee action=invokeResult
(sessionId=debugSession)
...
关于为什么iOS按预期工作的想法,但Android没有?