EarlGrey icon indicating copy to clipboard operation
EarlGrey copied to clipboard

EarlGrey 2 | Whitebox testing setup not working with cocoapods

Open szymon-kazmierczak opened this issue 6 years ago • 3 comments

I tried to make earlgrey2 whitebox testing setup work through cocoapods but with no success. Looks like the static libraries are missing and the app is crashing on launch. Sample repo:

https://github.com/Simon-Kaz/EarlGrey2Sample/tree/whiteboxing-attempt-v2

Whitebox-Setup branch has the bundle set up for whitebox testing, when you run the ui test the app crashes on launch.

The Master branch has a fully working sample app with the same (passing) test and was used as a base for whitebox testing setup.

szymon-kazmierczak avatar Jul 04 '19 16:07 szymon-kazmierczak

@szymon-kazmierczak The first thing I noticed was that the DistantObjectBundle was podding to the EarlGreyTest and not the App Pod. The initial error with not being able to load the bundle was removed after that.

The bundle is present in the application after that along with the AppFramework. We would need to test further by loading the bundle manually in the app.

tirodkar avatar Jul 08 '19 04:07 tirodkar

Cool, I've updated the project as suggested. I've also cleaned up the user header search paths. Currently the issue im seeing is:

'AppFramework/Action/GREYAction.h' file not found when trying to emit precompiled header /EarlGrey2Sample/eDOBundle/eDOBundle-Bridging-Header.h

Feels like appframework is not being linked correctly?

szymon-kazmierczak avatar Jul 08 '19 12:07 szymon-kazmierczak

@szymon-kazmierczak The first thing I notice is that the imports in your eDOBundle-Bridging-Header.h are not the proper modular imports that should be used with the EG2 pod. For example, if you look at the Demo/EarlGreyExample project's UITest imports they are all the <EarlGreyTest/> imports.

Additionally, you are referencing files that are not exposed as public headers in the EarlGreyTest.podspec, the notable one being GREYSyncAPI.h. Could you try to make those changes and see if there are still problems for you?

brettfazio avatar Aug 06 '19 01:08 brettfazio