描述
我有暂停的问题,我不知道为什么。它请求权限,然后设置权限(可能)。在这一刻,应用程序看起来已经加载,但在那之后,会显示带有旋转器的黑屏一段时间,然后显示闪屏。此时应用程序被卡住。
我发现了一些关于超时的问题,但我尝试了很多写在那里的东西,但都没用。我的同事试图在同一个项目上使用相同的软件包版本运行Detox,但没有问题。他有相同版本的React Native、XCode、Node、Mocha和Detox。
我尝试了什么:
- 节点的少数版本:8.1.3、8.9.1和9.1.0
- 重新安装节点
- 再次删除并安装node_modules(yarn/npm)
- 更换排毒版本:5.9.4和5.8.1
- 更改Mocha版本:4.0.1和3.5.2
- 在ios模拟器中删除并安装应用程序
- 升级XCode(9.0.1–>9.1)
- 重建排毒构建
- 删除npm缓存
- 删除排毒缓存
测试:
describe('Permissions', () => {
beforeEach(async () => {
await device.launchApp({permissions: {
notifications: 'YES',
location: 'always',
}});
await device.reloadReactNative()
});
it('should have welcome screen', async () => {
await element(by.id('searchCarsButton')).tap()
})
})
排毒、节点、设备、Xcode和macOS版本
- 排毒:5.9.4、5.8.1
- 节点:8.1.3
- 设备:ios模拟器
- Xcode:9.1
- macOS:Sierra
- React Native:0.44.0
设备和详细排毒日志
$ detox test --loglevel verbose
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --loglevel verbose
detox-server info 14:33:10: server listening on localhost:50396...
detox verb ws onOpen [object Object]
detox verb ws send: {"type":"login","params":{"sessionId":"c14ee5fe-de13-5f60-b61f-ff487043587b","role":"tester"},"messageId":0}
detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"c14ee5fe-de13-5f60-b61f-ff487043587b","role":"tester"},"messageId":0}
detox verb ws
detox verb 1: applesimutils --list "iPhone 7" --maxResults=1
detox info 1: Searching for device matching iPhone 7...
detox verb 1: stdout: [
detox verb 1: stdout: {
detox verb 1: stdout: "state" : "Booted",
detox verb 1: stdout: "availability" : "(available)",
detox verb 1: stdout: "name" : "iPhone 7",
detox verb 1: stdout: "udid" : "2EE82BFA-2351-4627-937C-B93904827F29",
detox verb 1: stdout: "os" : {
detox verb 1: stdout: "version" : "11.1",
detox verb 1: stdout: "availability" : "(available)",
detox verb 1: stdout: "name" : "iOS 11.1",
detox verb 1: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 1: stdout: "buildversion" : "15B87"
detox verb 1: stdout: }
detox verb 1: stdout: }
detox verb 1: stdout: ]
detox verb 1: stdout:
detox verb 2: applesimutils --list
detox verb 2: stdout: [
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple TV",
detox verb 2: stdout: "udid" : "2F518141-A525-47B9-9A33-E5AEE34A92FA",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "tvOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-1",
detox verb 2: stdout: "buildversion" : "15J580"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple TV 4K",
detox verb 2: stdout: "udid" : "EA308CF4-5A1F-41EC-AB1C-9E081C6860B4",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "tvOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-1",
detox verb 2: stdout: "buildversion" : "15J580"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple TV 4K (at 1080p)",
detox verb 2: stdout: "udid" : "4A9D24CE-469A-4BA9-86C5-6A6418B906B1",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "tvOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-1",
detox verb 2: stdout: "buildversion" : "15J580"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad (5th generation)",
detox verb 2: stdout: "udid" : "BDD2070B-24B7-4748-9FCD-1A7A542B1741",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Air",
detox verb 2: stdout: "udid" : "EE452C63-A1CB-47A4-9DDE-3C85586C4AB0",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Air 2",
detox verb 2: stdout: "udid" : "8D7EE2CD-A09B-41A9-B7B5-0FEC4634AE1C",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Pro (10.5-inch)",
detox verb 2: stdout: "udid" : "3487A5FF-3C7C-495A-BC8C-2B805908F3AB",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Pro (12.9-inch)",
detox verb 2: stdout: "udid" : "EF72BAC9-BD3B-422A-917B-259E1D4F049D",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Pro (12.9-inch) (2nd generation)",
detox verb 2: stdout: "udid" : "76F7BFE5-981E-4799-A42D-2B2C75CF6B89",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPad Pro (9.7-inch)",
detox verb 2: stdout: "udid" : "81042BB1-C6D3-4C50-98B6-5DDD226C0A24",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 5s",
detox verb 2: stdout: "udid" : "DC5CBF57-1804-4FB1-84B1-B47D32371F8D",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 6",
detox verb 2: stdout: "udid" : "0073B75C-D6DF-4F35-981E-965420C1F660",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 6 Plus",
detox verb 2: stdout: "udid" : "A8FC2524-4819-49F2-8694-FB03C27C68EE",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 6s",
detox verb 2: stdout: "udid" : "4B963220-4BD9-4389-AB2D-D5B739578F86",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 6s Plus",
detox verb 2: stdout: "udid" : "4973CA12-2A69-42ED-A2C2-42AAB9FB2DB7",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Booted",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 7",
detox verb 2: stdout: "udid" : "2EE82BFA-2351-4627-937C-B93904827F29",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 7 Plus",
detox verb 2: stdout: "udid" : "9D7D03DD-10CE-4529-A356-62479A5A6C6A",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 8",
detox verb 2: stdout: "udid" : "4C3124D0-5353-4471-BB7B-9D9FB30298A7",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone 8 Plus",
detox verb 2: stdout: "udid" : "D5350B7C-B7F9-4F36-B2F4-6D97D63C4869",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone SE",
detox verb 2: stdout: "udid" : "6EA12F63-932D-456B-B74F-68732DC65EFE",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iPhone X",
detox verb 2: stdout: "udid" : "30AB0A5F-1E84-4747-AC74-882A0823177F",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "11.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "iOS 11.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-1",
detox verb 2: stdout: "buildversion" : "15B87"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch - 38mm",
detox verb 2: stdout: "udid" : "E0A4995F-4B50-4E6A-B13C-FC8863F4A677",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch - 42mm",
detox verb 2: stdout: "udid" : "4CD40B3E-A994-4852-9058-22EAC2B26882",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch Series 2 - 38mm",
detox verb 2: stdout: "udid" : "F9A49912-44A6-40EF-AC72-224E05461CF2",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch Series 2 - 42mm",
detox verb 2: stdout: "udid" : "F23C9051-AF9B-401E-8DEC-B19BA31C7C0E",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch Series 3 - 38mm",
detox verb 2: stdout: "udid" : "16D30FC1-9D10-462B-B28C-1DC54D6D78D0",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: },
detox verb 2: stdout: {
detox verb 2: stdout: "state" : "Shutdown",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "Apple Watch Series 3 - 42mm",
detox verb 2: stdout: "udid" : "FE83E863-043D-4BB8-8C6F-3E0D5C39DD18",
detox verb 2: stdout: "os" : {
detox verb 2: stdout: "version" : "4.1",
detox verb 2: stdout: "availability" : "(available)",
detox verb 2: stdout: "name" : "watchOS 4.1",
detox verb 2: stdout: "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-1",
detox verb 2: stdout: "buildversion" : "15R844"
detox verb 2: stdout: }
detox verb 2: stdout: }
detox verb 2: stdout: ]
detox verb 2: stdout:
detox verb 3: /usr/bin/xcrun simctl uninstall 2EE82BFA-2351-4627-937C-B93904827F29 com.creativedock.hoppycar
detox info 3: Uninstalling com.creativedock.hoppycar...
detox info 3: com.creativedock.hoppycar uninstalled
detox verb 4: /usr/bin/xcrun simctl install 2EE82BFA-2351-4627-937C-B93904827F29 /Applications/MAMP/htdocs/droover/ios/build/Build/Products/Debug-iphonesimulator/hoppycar.app
detox info 4: Installing /Applications/MAMP/htdocs/droover/ios/build/Build/Products/Debug-iphonesimulator/hoppycar.app...
detox info 4: /Applications/MAMP/htdocs/droover/ios/build/Build/Products/Debug-iphonesimulator/hoppycar.app installed
detox verb 5: /usr/bin/xcrun simctl terminate 2EE82BFA-2351-4627-937C-B93904827F29 com.creativedock.hoppycar
detox info 5: Terminating com.creativedock.hoppycar...
detox info 5: com.creativedock.hoppycar terminated
detox verb 6: /bin/cat /dev/null >$HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.out 2>$HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/janvaclavik/Library/Detox/ios/dcbded2050005ff99b0bffc826182a2fb35fa7a4/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 2EE82BFA-2351-4627-937C-B93904827F29 com.creativedock.hoppycar --args -detoxServer ws://localhost:50396 -detoxSessionId c14ee5fe-de13-5f60-b61f-ff487043587b
detox info 6: Launching com.creativedock.hoppycar...
detox verb 6: stdout: com.creativedock.hoppycar: 28279
detox verb 6: stdout:
detox info 6: com.creativedock.hoppycar launched. The stdout and stderr logs were recreated, you can watch them with:
tail -F $HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.{out,err}
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
detox verb ws onMessage: {"type":"ready","messageId":-1000,"params":{}}
detox verb ws
Permissions
detox verb 7: applesimutils --simulator 2EE82BFA-2351-4627-937C-B93904827F29 --bundle com.creativedock.hoppycar --setPermissions notifications=YES,location=always
detox info 7: Trying to set permissions...
detox info 7: Permissions are set
detox verb 8: /bin/cat /dev/null >$HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.out 2>$HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/janvaclavik/Library/Detox/ios/dcbded2050005ff99b0bffc826182a2fb35fa7a4/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 2EE82BFA-2351-4627-937C-B93904827F29 com.creativedock.hoppycar --args -detoxServer ws://localhost:50396 -detoxSessionId c14ee5fe-de13-5f60-b61f-ff487043587b
detox info 8: Launching com.creativedock.hoppycar...
detox verb 8: stdout: com.creativedock.hoppycar: 28306
detox verb 8: stdout:
detox info 8: com.creativedock.hoppycar launched. The stdout and stderr logs were recreated, you can watch them with:
tail -F $HOME/Library/Developer/CoreSimulator/Devices/2EE82BFA-2351-4627-937C-B93904827F29/data/tmp/detox.last_launch_app_log.{out,err}
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
detox verb ws onMessage: {"type":"ready","messageId":-1000,"params":{}}
detox verb ws
detox verb ws send: {"type":"reactNativeReload","params":{},"messageId":-1000}
detox verb ws onMessage: {"type":"ready","messageId":-1000,"params":{}}
detox verb ws
detox verb ws send: {"type":"invoke","params":{"target":{"type":"Invocation","value":{"target":{"type":"EarlGrey","value":"instance"},"method":"detox_selectElementWithMatcher:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYMatchers"},"method":"matcherForAccessibilityID:","args":[{"type":"NSString","value":"searchCarsButton"}]}}]}},"method":"performAction:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYActions"},"method":"actionForTap","args":[]}}]},"messageId":1}
1) should have welcome screen
detox verb ws send: {"type":"cleanup","params":{"stopRunner":true},"messageId":2}
detox verb ws onMessage: {"type":"cleanupDone","messageId":2,"params":{}}
detox verb ws
0 passing (3m)
1 failing
1) Permissions should have welcome screen:
Error: Timeout of 135000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
child_process.js:631
throw err;
^
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --loglevel verbose
at checkExecSyncError (child_process.js:588:13)
at Object.execSync (child_process.js:628:13)
at runMocha (/usr/local/lib/node_modules/detox/local-cli/detox-test.js:56:6)
at Object.<anonymous> (/usr/local/lib/node_modules/detox/local-cli/detox-test.js:36:5)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
排毒.last_launch_app_log.{out,err}:
...
2017-11-13 12:20:55.393 dr[26453:980543] ☣️ DETOX:: Ignoring timer: 35 failure reason: "duration>1.5"
2017-11-13 12:20:57.402 dr[26453:980543] ☣️ DETOX:: Ignoring timer: 36 failure reason: "duration>1.5"
2017-11-13 12:20:59.410 dr[26453:980543] ☣️ DETOX:: Ignoring timer: 37 failure reason: "duration>1.5"
...
这个错误实际上给您带来了问题。"对于异步测试和挂钩,请确保调用"done()";">
我认为您的问题是,您正在使用async将函数转换为promise,而测试框架不知道什么时候完成了thet。
删除async/await,只使用普通的.then(),完成后,调用done()函数。这应该会结束测试。
更多信息请点击此处:https://mochajs.org/#asynchronous-代码