Skip to content
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

Add a screenshot to scenario in AfterScenario #63

Open
badrinrs opened this issue Jan 12, 2023 · 1 comment
Open

Add a screenshot to scenario in AfterScenario #63

badrinrs opened this issue Jan 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@badrinrs
Copy link

badrinrs commented Jan 12, 2023

Is your feature request related to a problem? Please describe.
Since Cucumber does not extend XCTestCase, I am unable to add a screenshot at the end of scenario

Describe the solution you'd like
In AfterScenario Hook, an additional parameter is provided to take screenshot at the start of afterScenario and save. That would be great.

Describe alternatives you've considered

AfterScenario { scenario in
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)

In the above code, add method is not accepted as it is used in extension of XCTestCase.

Additional context
This would greatly help in debugging apps when running scenarios on an end to end basis.

@Tyler-Keith-Thompson
Copy link
Owner

This seems like a totally fair ask...I'm slammed with work at the moment so I won't be able to turn this around super quickly. It certainly seems possible, cause test cases are generated.

PRs are welcome, when my schedule eases up I'll put this on the Kanban board so that it's obvious it's being addressed.

@Tyler-Keith-Thompson Tyler-Keith-Thompson added the enhancement New feature or request label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants