Texture Framework causing FBSnapshotTestCase UI Testing framework to fail due to a diff in the UI (with suggested solution)
Description of the issue: We have an SDK that utilizes the Texture library and when applications integrate our SDK while using FBSnapshotTestCase Framework to run UI Tests, tests will fail showing diff failure between different UI elements. in the example below we will see one example of UI changing (this time - its round corners but not limited only to that). while only using Texture framework
Texture Version: 3.0.0-rc.2 Xcode version: 13.1 idevice + iOS Version: iPhone 11 Pro running iOS 14.0.1 link to example project containing this description and an example project (Already include texture) to reproduce the issue: https://github.com/0xkuj/Example_APP_with_Snapshot_and_Texture
Informative description:
Example FBSnapshotTestCase with Snapshot and Texture
this repository contains an example app to include a reproduction of an issue with the Texture framework combined with FBSnapshotTestCase.
Description of the issue: Integrating Texture Framework while using FBSnapshotTestCase Framework to run UI Tests, tests will fail showing diff failure between different UI elements. in the example below we will see one example of UI changing (this time - its round corners but not limited only to that).
Below - Instructions on how to reproduce the failures using the example app from this repository:
-
Download the zip file "Example_app_with_texture_and_FBSnapshotTestCase.zip" from this repo (or clone this repo by using "git clone https://github.com/0xkuj/Example_APP_with_Snapshot_and_Texture.git"
-
Unzip the file and open "App.xcodeproj" (Note - I use Xcode 13.1 but it is probably not a must)
-
Make sure "AsyncDisplayKit.xcodeproj" is under "Core"

- Make sure the "Core" Target is using "AsyncDisplayKit.framework"

- Go to Test Navigator tab in Xcode
- Make sure your simulator is on device running 14.0.1 (this should not be iOS specific, but this test case is working 100% of the times) (I am using iPhone 11 Pro with iOS 14.0.1)
- run the tests named "FeatureTests" - this stage will run the UI tests using the "Snapshot" framework. tests will must likely fail. in the diff file ("FailureDiffs")

- Check the failure diff inside the folder, and the diff will look like this:

This actually means that the Snapshot framework is trying to compare between a screen it expects to find
vs what it actually finds (this is due to Texture framework integration - once the Texture framework is removed from within the "Core" frameworks list {stage 4} the issue is gone)

Consider - Suggested solution:
We found that moving the initialization of allowsGroupOpacityFromUIKitOrNil and allowsEdgeAntialiasingFromUIKitOrNil from
"ASInitializeFrameworkMainThread(void)" to their respective functions before being used (in this one and only time) (BOOL ASDefaultAllowsGroupOpacity() and BOOL ASDefaultAllowsEdgeAntialiasing()) will solve this issue.
