facebookarchive / ios-snapshot-test-case

Snapshot view unit tests for iOS
MIT License
2.66k stars 253 forks source link

Any way we can use this with XC UI Tests.? #217

Closed sukesh1989 closed 4 years ago

sukesh1989 commented 7 years ago

Any way we can use this with XC UI Tests.? I want to compare screenshots of app and determine the video rendering and player features. Can you please help? Can i pass XCUIELEMENT or XCUIAPPLICATION objects somehow?

Grubas7 commented 7 years ago

@sukesh1989 Unit tests and UI tests inherits files from XCTestCase. Same as FBSnapshotTestCase so you should be able to take a snapshot in your UI test.

alextakahashi commented 7 years ago

I was trying to implement FBSnapshotTestCase with my UITests, but I couldn't generate a view / layer from the XCUIApplication. If I could simply get a snapshot of the simulator that would be great.

I haven't had a ton of experience working with XCUIElement. I'd really appreciate any help!

acecilia commented 6 years ago

See: https://medium.com/@joesusnick/snapshot-xcui-testing-6a16c7ccd47b for a implementation example