Xcode UI test manual snapshot

2019-04-10 15:08发布

I want to manually take some snapshots from my applications using UI Tests intoduced in Xcode 7. By default, Xcode takes screenshots of every step and in result I got screenshots that was taken in the middle of transitions between view controllers. I want to manually take snapshot in the specific moments. Any ideas how to do this? I know how to take screenshot of UIView, but XCUIApplication doesn't provide any API to get UIView objects.

1条回答
叛逆
2楼-- · 2019-04-10 15:58

I've created a library for this: https://github.com/zmeyc/UITestUtils The idea is to take the screenshot in the app itself and send it to the test app via sockets. I didn't find a way to capture screenshots in a controlled manner directly from the test app.

查看更多
登录 后发表回答