排毒::超时-在jest.setTimeout

时间:2018-07-20 09:45:32

标签: detox

我正在尝试在ios模拟器上设置Detox。排毒能够启动应用程序,我可以看到入职屏幕。但是,排毒功能不会单击某个元素并抛出

错误
  

“超时-在jest.setTimeout指定的120000ms超时内未调用异步回调。         在映射器(../ node_modules / jest-jasmine2 / build / queue_runner.js:41:52)“

版本详细信息:

  • 节点:v8.11.3
  • npm:5.6.0
  • react-native-cli:2.0.1
  • 本机:0.53.3
  • Xcode:9.4.1
  • 排毒:8.0.0
  • iOS模拟器:iPhone 7-11.4

 "devDependencies": {
            "detox": "^8.0.0",
            "jest": "^23.4.1",
            "mocha": "^5.2.0",
            "react-native-schemes-manager": "^1.0.4"
          },


        "dependencies": {
            "react": "^16.2.0",
            "react-native": "^0.53.3",
        }

这是完全错误:

CF-LP00152:myProject-mobile user$ detox test -c ios.sim.debug -l verbose
node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:android:).)*$'
 server listening on localhost:57282...
 onOpen [object Object]
 send: {"type":"login","params":{"sessionId":"13bb22bd-b2f0-05a1-eb13-76b79a784e2a","role":"tester"},"messageId":0}
 onMessage: {"type":"loginSuccess","params":{"sessionId":"13bb22bd-b2f0-05a1-eb13-76b79a784e2a","role":"tester"},"messageId":0}
  rbx
 : /usr/bin/xcrun simctl list -j
1: stdout: {
  "devicetypes" : [
    {
      "name" : "iPhone 4s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s"
    },
    {
      "name" : "iPhone 5",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5"
    },
    {
      "name" : "iPhone 5s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5s"
    },
    {
      "name" : "iPhone 6",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6"
    },
    {
      "name" : "iPhone 6 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus"
    },
    {
      "name" : "iPhone 6s",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s"
    },
    {
      "name" : "iPhone 6s Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus"
    },
    {
      "name" : "iPhone 7",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7"
    },
    {
      "name" : "iPhone 7 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus"
    },
    {
      "name" : "iPhone 8",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8"
    },
    {
      "name" : "iPhone 8 Plus",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus"
    },
    {
      "name" : "iPhone SE",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE"
    },
    {
      "name" : "iPhone X",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-X"
    },
    {
      "name" : "iPad 2",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-2"
    },
    {
      "name" : "iPad Retina",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Retina"
    },
    {
      "name" : "iPad Air",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air"
    },
    {
      "name" : "iPad Air 2",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air-2"
    },
    {
      "name" : "iPad (5th generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-"
    },
    {
      "name" : "iPad Pro (9.7-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-"
    },
    {
      "name" : "iPad Pro (12.9-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro"
    },
    {
      "name" : "iPad Pro (12.9-inch) (2nd generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-"
    },
    {
      "name" : "iPad Pro (10.5-inch)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-"
    },
    {
      "name" : "iPad (6th generation)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation-"
    },
    {
      "name" : "Apple TV",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p"
    },
    {
      "name" : "Apple TV 4K",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K"
    },
    {
      "name" : "Apple TV 4K (at 1080p)",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p"
    },
    {
      "name" : "Apple Watch - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm"
    },
    {
      "name" : "Apple Watch - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm"
    },
    {
      "name" : "Apple Watch Series 2 - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm"
    },
    {
      "name" : "Apple Watch Series 2 - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm"
    },
    {
      "name" : "Apple Watch Series 3 - 38mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm"
    },
    {
      "name" : "Apple Watch Series 3 - 42mm",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm"
    }
  ],
  "runtimes" : [
    {
      "buildversion" : "15F79",
      "availability" : "(available)",
      "name" : "iOS 11.4",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-4",
      "version" : "11.4"
    },
    {
      "buildversion" : "15L576",
      "availability" : "(available)",
      "name" : "tvOS 11.4",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-4",
      "version" : "11.4"
    },
    {
      "buildversion" : "15T212",
      "availability" : "(available)",
      "name" : "watchOS 4.3",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-3",
      "version" : "4.3"
    }
  ],
  "devices" : {
    "watchOS 4.3" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch - 38mm",
        "udid" : "BD4F50DF-B5A5-47D4-B114-F3DCCAF09632"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch - 42mm",
        "udid" : "6FBD2422-0F17-4234-82E2-0A06575243B5"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 2 - 38mm",
        "udid" : "F197E96B-6595-4C10-AC7A-AE70D46AF198"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 2 - 42mm",
        "udid" : "8FE0C961-0799-41F9-A2A7-837FE6D2C266"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 3 - 38mm",
        "udid" : "9A4DC9CF-8ED4-466F-AA43-093A64CF6FE5"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple Watch Series 3 - 42mm",
        "udid" : "DDE4CDA0-01D6-4AA4-9A28-9E26DBD43B24"
      }
    ],
    "iOS 11.4" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 5s",
        "udid" : "D9CF19E0-4A88-4F9A-AA3C-AA8385A2F07D"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6",
        "udid" : "DF44D9A4-6657-41BB-B785-2BB3698388D4"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6 Plus",
        "udid" : "433BEF55-9F52-44EC-972C-CD36C68A56EF"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6s",
        "udid" : "51515BFD-7841-411A-9653-B919CB7D71D7"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 6s Plus",
        "udid" : "4BDD3545-17DB-4715-9119-1B27629A85A9"
      },
      {
        "state" : "Booted",
        "availability" : "(available)",
        "name" : "iPhone 7",
        "udid" : "7B7A3A94-372F-4872-8BD0-F7BC50CA2924"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 7 Plus",
        "udid" : "C1A05912-D15F-4680-8890-BEAA8034334B"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 8",
        "udid" : "F51C995C-77C7-4AD9-A3EE-0BD1BCCD65E1"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone 8 Plus",
        "udid" : "1A793458-CB9B-4A7C-A094-B4620F38087E"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone SE",
        "udid" : "3CA7F470-5094-4500-9B15-633520CE88B9"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPhone X",
        "udid" : "E42AFE7E-CF7C-483E-90FC-A6F53857222A"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Air",
        "udid" : "3E20D6A4-232E-4C52-B739-0A6F757E482E"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Air 2",
        "udid" : "41CFDFDB-C7F5-4DB3-957D-DABF3B12134E"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad (5th generation)",
        "udid" : "017D3575-29F5-4406-B778-0C0367E270DE"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (9.7-inch)",
        "udid" : "208367C1-EBD8-4A48-AF9D-2B2B6C74ACBB"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (12.9-inch)",
        "udid" : "C84AF8EC-6BA7-44C5-9D46-3CBA097E5775"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (12.9-inch) (2nd generation)",
        "udid" : "5812C3B0-E2DE-4B0E-ABF9-B49A3B7F1BC0"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "iPad Pro (10.5-inch)",
        "udid" : "4B3F04CD-91E0-4A71-8ECE-0E3B6D2311A0"
      }
    ],
    "tvOS 11.4" : [
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV",
        "udid" : "18E73180-EB09-49A0-8F93-688A28574C04"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV 4K",
        "udid" : "2FF9F8FD-370D-4A36-BA8F-4466C3619945"
      },
      {
        "state" : "Shutdown",
        "availability" : "(available)",
        "name" : "Apple TV 4K (at 1080p)",
        "udid" : "569B256D-3314-4FCC-8DA2-E3FA9E7D83A3"
      }
    ]
  },
  "pairs" : {
    "D932E3EE-D546-47BB-BB13-3F0D6AD85A12" : {
      "watch" : {
        "name" : "Apple Watch Series 2 - 38mm",
        "udid" : "F197E96B-6595-4C10-AC7A-AE70D46AF198",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone 7",
        "udid" : "7B7A3A94-372F-4872-8BD0-F7BC50CA2924",
        "state" : "Booted"
      },
      "state" : "(active, disconnected)"
    },
    "61A07BD6-29FF-435E-9132-67DFB4745F20" : {
      "watch" : {
        "name" : "Apple Watch Series 3 - 42mm",
        "udid" : "DDE4CDA0-01D6-4AA4-9A28-9E26DBD43B24",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone 8 Plus",
        "udid" : "1A793458-CB9B-4A7C-A094-B4620F38087E",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    },
    "578EC0CC-0B99-4235-B7B1-9EF7422AB4A4" : {
      "watch" : {
        "name" : "Apple Watch Series 2 - 42mm",
        "udid" : "8FE0C961-0799-41F9-A2A7-837FE6D2C266",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone 7 Plus",
        "udid" : "C1A05912-D15F-4680-8890-BEAA8034334B",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    },
    "F9FC7B3F-6D87-4956-B0AD-6E6FE4E5C2EB" : {
      "watch" : {
        "name" : "Apple Watch Series 3 - 38mm",
        "udid" : "9A4DC9CF-8ED4-466F-AA43-093A64CF6FE5",
        "state" : "Shutdown"
      },
      "phone" : {
        "name" : "iPhone 8",
        "udid" : "F51C995C-77C7-4AD9-A3EE-0BD1BCCD65E1",
        "state" : "Shutdown"
      },
      "state" : "(active, disconnected)"
    }
  }
}

 : applesimutils --list --byType "iPhone 7" --byOS "11.4"
 : Searching for device matching iPhone 7...
2: stdout: [
  {
    "deviceType" : {
      "name" : "iPhone 7",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7"
    },
    "state" : "Booted",
    "availability" : "(available)",
    "name" : "iPhone 7",
    "udid" : "7B7A3A94-372F-4872-8BD0-F7BC50CA2924",
    "os" : {
      "version" : "11.4",
      "availability" : "(available)",
      "name" : "iOS 11.4",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-4",
      "buildversion" : "15F79"
    }
  }
]

 : applesimutils --list --byId "7B7A3A94-372F-4872-8BD0-F7BC50CA2924"
3: stdout: [
  {
    "deviceType" : {
      "name" : "iPhone 7",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7"
    },
    "state" : "Booted",
    "availability" : "(available)",
    "name" : "iPhone 7",
    "udid" : "7B7A3A94-372F-4872-8BD0-F7BC50CA2924",
    "os" : {
      "version" : "11.4",
      "availability" : "(available)",
      "name" : "iOS 11.4",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-4",
      "buildversion" : "15F79"
    }
  }
]

 : /usr/bin/xcrun simctl uninstall 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 my.project.ios
 : Uninstalling my.project.ios...
 : my.project.ios uninstalled
 : /usr/bin/xcrun simctl install 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 "/Users/[Path]/myProject-mobile/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app"
 : Installing /Users/[Path]/myProject-mobile/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app...
 : /Users/[Path]/myProject-mobile/ios/build/Build/Products/Debug-iphonesimulator/MyProject.app installed
 : /usr/bin/xcrun simctl terminate 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 my.project.ios
 : Terminating my.project.ios...
 : my.project.ios terminated
7: /bin/cat /dev/null >/Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.out 2>/Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/user/Library/Detox/ios/6835fdc9621ba06e099f505790cc7b06d2e6c1b5/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 7B7A3A94-372F-4872-8BD0-F7BC50CA2924 my.project.ios --args  detoxServer ws://localhost:57282 -detoxSessionId 13bb22bd-b2f0-05a1-eb13-76b79a784e2a
 : Launching my.project.ios...
7: stdout: my.project.ios: 72948

7: my.project.ios launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.{out,err}
 send: {"type":"isReady","params":{},"messageId":-1000}
 finalized artifacts successfully
 FAIL  e2e/firstTest.spec.js (121.138s)
  MyProject
    ✕ should have welcome screen (6ms)

  ● MyProject › should have welcome screen

    Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

      at mapper (../node_modules/jest-jasmine2/build/queue_runner.js:41:52)

  ● MyProject › should have welcome screen

    ReferenceError: device is not defined

      1 | describe('MyProject', () => {
      2 |   beforeEach(async () => {
    > 3 |     await device.reloadReactNative();
        |           ^
      4 |   });
      5 | 
      6 |   it('should have welcome screen', async () => {

      at Object._callee$ (firstTest.spec.js:3:11)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
      at ../node_modules/regenerator-runtime/runtime.js:195:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
      at Object._callee (firstTest.spec.js:2:14)

  ● MyProject › should have welcome screen

    ReferenceError: element is not defined

      4 |   });
      5 | 
    > 6 |   it('should have welcome screen', async () => {
        |                                    ^
      7 |     await expect(element(by.text('SKIP'))).toBeVisible();
      8 |     await element(by.text('SKIP')).tap();
      9 |   });

      at Object._callee2$ (firstTest.spec.js:6:36)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
      at ../node_modules/regenerator-runtime/runtime.js:195:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
      at Object._callee2 (firstTest.spec.js:6:36)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        121.845s, estimated 122s
Ran all test suites matching /e2e/i with tests matching "^((?!:android:).)*$".
child_process.js:644
    throw err;
    ^

Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:android:).)*$'
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at runJest (/Users/[Path]/myProject-mobile/node_modules/detox/local-cli/detox-test.js:146:6)
    at run (/Users/[Path]/myProject-mobile/node_modules/detox/local-cli/detox-test.js:81:7)
    at Object.<anonymous> (/Users/[Path]/myProject-mobile/node_modules/detox/local-cli/detox-test.js:191:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

detox.test.launch.app.log

Last login: Fri Jul 20 13:48:15 on ttys028
CF-LP00152:~ user$ tail -F /Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.{out,err}

==> /Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.out <==

==> /Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/tmp/detox.last_launch_app_log.err <==

<~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~~+~>
2018-07-20 14:05:39.766 MyProject[73492:440330] [INFO]  AppsFlyer: -[AppsFlyerHTTPClient sendRequestEventToServer:isRequestFromCache:appID:isDebug:completionHandler:] sending request to server 
2018-07-20 14:05:39.859 MyProject[73492:440331] [DEBUG] AppsFlyer: -[AppsFlyerHTTPClient sendRequestEventToServer:isRequestFromCache:appID:isDebug:completionHandler:]_block_invoke sent information to server, status = 200
2018-07-20 14:05:39.860 MyProject[73492:440331] [DEBUG] AppsFlyer: -[AppsFlyerRequestCache getCacheDirectoryPath] cache dir: /Users/user/Library/Developer/CoreSimulator/Devices/7B7A3A94-372F-4872-8BD0-F7BC50CA2924/data/Containers/Data/Application/9CAB4223-2619-410A-A5F0-DAC904776C8C/Library/Caches/AppsFlyerCache
2018-07-20 14:05:39.860 MyProject[73492:440331] [DEBUG] AppsFlyer: -[AppsFlyerRequestCache processCache] Cache size 0
2018-07-20 14:05:39.860 MyProject[73492:440331] [DEBUG] AppsFlyer: -[AppsFlyerTracker executeRequestWithRequestType:urlString:parameters:completionHandler:]_block_invoke_2 isBackgroundEnabled: 0
2018-07-20 14:05:40.773 MyProject[73492:440329] [DEBUG] AppsFlyer: -[AppsFlyerHTTPClient sendRequestEventToServer:isRequestFromCache:appID:isDebug:completionHandler:]_block_invoke sent information to server, status = 200
2018-07-20 14:05:40.774 MyProject[73492:440329] [DEBUG] AppsFlyer: -[AppsFlyerRequestCache processCache] Cache size 0
2018-07-20 14:05:40.774 MyProject[73492:440329] [DEBUG] AppsFlyer: -[AppsFlyerTracker executeRequestWithRequestType:urlString:parameters:completionHandler:]_block_invoke_2 isBackgroundEnabled: 0

init.js

const detox = require('detox');
const config = require('../package.json').detox;
const adapter = require('detox/runners/jest/adapter');

jest.setTimeout(120000);
jasmine.getEnv().addReporter(adapter);

beforeAll(async () => {
  await detox.init(config);
});

beforeEach(async () => {
  await adapter.beforeEach();
});

afterAll(async () => {
  await adapter.afterAll();
  await detox.cleanup();
});

Config.js

{
    "setupTestFrameworkScriptFile": "./init.js"
}

注意:使用示例应用程序,Detox运行正常。

1 个答案:

答案 0 :(得分:0)

打开一个单独的终端 并运行 npm start -- --reset-cache