-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshots #131
Comments
@robwhitlock666 Will XCUIScreenshot work for you? |
@rookiezn I tried XCUIScreenshot in screen definition files, like below func addScreenshot() {
let fullScreenshot = XCUIScreen.main.screenshot()
let screenshot = XCTAttachment(screenshot: fullScreenshot)
screenshot.lifetime = .keepAlways
// if we don't set lifetime to .keepAlways, Xcode will delete the image if the test passes.
add(screenshot)
} but couldn't find the screenshot/attachment in the xcode test report, no idea why? |
@rookiezn I found this inside the code base
I am able to attach screenshot with this
Remember to disable delete attachment on success in Test Scheme -> Options (Xcode 14) For attach screenshot as embedded data to JSON report, you can add this line |
Do screenshots for failed tests work out of the box? Since we don't really have access to the XCTestCase being generated, we can't do our own screenshot management. Any help appreciated.
The text was updated successfully, but these errors were encountered: