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

DocLocScreenshotTestCase does not save failure screenshots #96

Closed
aartikov opened this issue Feb 10, 2020 · 3 comments · Fixed by #413
Closed

DocLocScreenshotTestCase does not save failure screenshots #96

aartikov opened this issue Feb 10, 2020 · 3 comments · Fixed by #413
Assignees
Labels
bug Something isn't working

Comments

@aartikov
Copy link
Contributor

Steps to reproduce:

  1. Change kaspressample.docloc_tests.ScreenshotSampleTest to make it failing.
  2. Run the test.
  3. Open "sdcard/screenshots/en" in Device File Explorer.

Expected behavior: "fails" directory contains a failure screenshot.

Actual behavior: "fails" directory is empty. Logcat has java.lang.IllegalArgumentException: Could not find test class!

Tested on Emulator API 26, x86_64.

@matzuk matzuk added the bug Something isn't working label Feb 10, 2020
@matzuk
Copy link
Member

matzuk commented Feb 1, 2021

@aartikov Hi!
Is the issue actual?

@AzamatCherchesov
Copy link
Collaborator

@aartikov Hi!
Thanks for your issue.
Is the issue actual?

@Nikitae57
Copy link
Collaborator

Nikitae57 commented Nov 7, 2022

Hi, @aartikov! Indeed, current approach with TestRule doesn't work for several reasons. Right now you could fix it by adding ScreenshotStepWatcherInterceptor interceptor to your test case constructor e.g.

Kaspresso.Builder.simple().apply {
    stepWatcherInterceptors.add(ScreenshotStepWatcherInterceptor(screenshots))
}

There's a PR that aims to take "fail" screenshots out of the box

Nikitae57 added a commit that referenced this issue Nov 7, 2022
Nikitae57 added a commit that referenced this issue Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants