wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.14k stars 1.92k forks source link

Detox fails with TrustKit integrated #721

Closed Milesyan closed 5 years ago

Milesyan commented 6 years ago

Description

App crashed when I start to run the test in demoProject. If TrustKit is not integrated or kTSKSwizzleNetworkDelegates: @YES is not added in trustKitConfig, everything works fine.

Demo Project

demoProject.zip

Steps to Reproduce

  1. yarn/npm install
  2. build app with: detox build -c ios.sim.debug
  3. run test with: detox test -c ios.sim.debug -l verbose

Device and verbose Detox logs

2018-05-10 11:18:02.817 [info][tid:main][RCTCxxBridge.mm:210] Initializing <RCTCxxBridge: 0x60c0001d5630> (parent: <RCTBridge: 0x6080000cf420>, executor: (null))
2018-05-10 11:18:02.886 [warn][tid:main][RCTBridge.m:119] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-05-10 11:18:02.902 [warn][tid:main][RCTModuleData.mm:67] Module RCTImageLoader requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2018-05-10 11:18:02.911 demoProject[69662:20606976] === TrustKit: Proxy-ing NSURLSessionDelegate: RCTMultipartDataTask
2018-05-10 11:18:02.912 demoProject[69662:20606976] Swizzling Method(s) not found while swizzling class TSKNSURLSessionDelegateProxy.
2018-05-10 11:18:02.912 demoProject[69662:20606976] Fatal failure: Cannot swizzle -[TSKNSURLSessionDelegateProxy URLSession:task:didCompleteWithError:] in <TSKNSURLSessionDelegateProxy: 0x6080002395e0> in /Users/Miles/repos/demoProject/node_modules/detox/ios_src/EarlGrey/EarlGrey/Additions/NSURLSession+GREYAdditions.m:77
LeoNatan commented 6 years ago

Thanks!

LeoNatan commented 6 years ago

I see the issue. Not sure if there is much I can do, it's a problem with Earl Grey. Investigating.

LeoNatan commented 6 years ago

I might be able to push a pull request for Earl Grey.

LeoNatan commented 6 years ago

PR: https://github.com/google/EarlGrey/pull/710

Detox is blocked until this is pulled and we can upgrade.

yogeshthanvi commented 6 years ago

Hi @LeoNatan any updates on this.

LeoNatan commented 5 years ago

Good news, our PR was accepted and we will update Earl Grey soon to include the fix. Closing in favor of #1392.