Kaspresso: Not able to run Allure supported tests that generate a video, screenshot or logcat output

Describe the bug I am trying to run the samples from the repository that demonstrate on how to use Allure interceptors. Test I am trying to run is com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest.

For me it looks like there are no permissions to create anything on the emulated sdcard but not sure why it is like this.

To Reproduce Steps to reproduce the behavior:

  1. Go to com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest
  2. Ensure an emulator is running
  3. Run the AllureSupportTest test suite
  4. Open logcat console
  5. See errors reported by the tool

Sample error stacks.

Failing logcat report:

2022-12-29 13:09:24.738 KASPRESSO I Dump logcat buffer to /storage/emulated/0/Documents/logcat/com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest/counter/TestLogcat.txt: logcat -b default -d -t "12-29 13:08:09.648" -s "KASPRESSO","KASPRESSO_TEST" 2022-12-29 13:09:24.740 KASPRESSO E Dump logcat buffer error: java.io.FileNotFoundException: /storage/emulated/0/Documents/logcat/com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest/counter/TestLogcat.txt: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileOutputStream.<init>(FileOutputStream.java:235) at java.io.FileOutputStream.<init>(FileOutputStream.java:186) at com.kaspersky.kaspresso.device.logcat.LogcatImpl.dumpLogcat(LogcatImpl.kt:94) at com.kaspersky.kaspresso.device.logcat.Logcat$DefaultImpls.dumpLogcat$default(Logcat.kt:41) at com.kaspersky.kaspresso.device.logcat.dumper.LogcatDumperImpl.doDump(LogcatDumperImpl.kt:34) at com.kaspersky.kaspresso.device.logcat.dumper.LogcatDumperImpl.dumpAndApply(LogcatDumperImpl.kt:29) at com.kaspersky.components.alluresupport.interceptors.testrun.DumpLogcatTestInterceptor.onTestFinished(DumpLogcatTestInterceptor.kt:17) at com.kaspersky.kaspresso.interceptors.watcher.testcase.impl.composite.TestRunCompositeWatcherInterceptor.onTestFinished(TestRunCompositeWatcherInterceptor.kt:193) at com.kaspersky.kaspresso.testcases.core.TestRunner.run(TestRunner.kt:87) at com.kaspersky.kaspresso.testcases.core.sections.MainTestSection.run(MainTestSection.kt:29) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run(BaseTestCase.kt:92) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run$default(BaseTestCase.kt:87) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest.counter(AllureSupportTest.kt:22) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:67) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:58) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:446) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(Forwar 2022-12-29 13:09:24.742 KASPRESSO E Logcat dumping error occurred: java.io.FileNotFoundException: /storage/emulated/0/Documents/logcat/com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest/counter/TestLogcat.txt: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileInputStream.<init>(FileInputStream.java:159) at com.kaspersky.components.alluresupport.files.AttachToReportKt.attachLogcatToAllureReport(AttachToReport.kt:8) at com.kaspersky.components.alluresupport.interceptors.testrun.DumpLogcatTestInterceptor$onTestFinished$1.invoke(DumpLogcatTestInterceptor.kt:17) at com.kaspersky.components.alluresupport.interceptors.testrun.DumpLogcatTestInterceptor$onTestFinished$1.invoke(DumpLogcatTestInterceptor.kt:17) at com.kaspersky.kaspresso.device.logcat.dumper.LogcatDumperImpl.doDump(LogcatDumperImpl.kt:39) at com.kaspersky.kaspresso.device.logcat.dumper.LogcatDumperImpl.dumpAndApply(LogcatDumperImpl.kt:29) at com.kaspersky.components.alluresupport.interceptors.testrun.DumpLogcatTestInterceptor.onTestFinished(DumpLogcatTestInterceptor.kt:17) at com.kaspersky.kaspresso.interceptors.watcher.testcase.impl.composite.TestRunCompositeWatcherInterceptor.onTestFinished(TestRunCompositeWatcherInterceptor.kt:193) at com.kaspersky.kaspresso.testcases.core.TestRunner.run(TestRunner.kt:87) at com.kaspersky.kaspresso.testcases.core.sections.MainTestSection.run(MainTestSection.kt:29) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run(BaseTestCase.kt:92) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run$default(BaseTestCase.kt:87) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest.counter(AllureSupportTest.kt:22) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:67) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:58) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:446) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189)

Failed screenshot

2022-12-29 13:09:24.731 UiDevice E failed to save screen shot to file java.io.FileNotFoundException: /storage/emulated/0/Documents/screenshots/com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest/counter/AllureSupportTest_step_5.png: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileOutputStream.<init>(FileOutputStream.java:235) at java.io.FileOutputStream.<init>(FileOutputStream.java:186) at androidx.test.uiautomator.UiDevice.takeScreenshot(UiDevice.java:1028) at com.kaspersky.kaspresso.device.screenshots.screenshotmaker.ExternalScreenshotMaker.takeScreenshot(ExternalScreenshotMaker.kt:24) at com.kaspersky.kaspresso.device.screenshots.screenshotmaker.CombinedScreenshotMaker.takeScreenshot(CombinedScreenshotMaker.kt:17) at com.kaspersky.kaspresso.device.screenshots.ScreenshotsImpl.doTakeAndApply(ScreenshotsImpl.kt:41) at com.kaspersky.kaspresso.device.screenshots.ScreenshotsImpl.takeAndApply(ScreenshotsImpl.kt:31) at com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor.intercept(ScreenshotStepInterceptor.kt:21) at com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor.interceptAfterWithSuccess(ScreenshotStepInterceptor.kt:13) at com.kaspersky.kaspresso.testcases.core.testcontext.TestContext.step(TestContext.kt:43) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest$counter$1.invoke(AllureSupportTest.kt:59) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest$counter$1.invoke(AllureSupportTest.kt:22) at com.kaspersky.kaspresso.testcases.core.TestRunner.runMainTestSection(TestRunner.kt:146) at com.kaspersky.kaspresso.testcases.core.TestRunner.run(TestRunner.kt:59) at com.kaspersky.kaspresso.testcases.core.sections.MainTestSection.run(MainTestSection.kt:29) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run(BaseTestCase.kt:92) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run$default(BaseTestCase.kt:87) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest.counter(AllureSupportTest.kt:22) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) 2022-12-29 13:09:24.732 UiDevice E at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:67) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:58) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:446) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) at libcore.io.IoBridge.open(IoBridge.java:482) ... 51 more 2022-12-29 13:09:24.734 KASPRESSO E An error while making screenshot occurred: java.io.FileNotFoundException: /storage/emulated/0/Documents/screenshots/com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest/counter/AllureSupportTest_step_5.png: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileInputStream.<init>(FileInputStream.java:159) at com.kaspersky.components.alluresupport.files.AttachToReportKt.attachScreenshotToAllureReport(AttachToReport.kt:22) at com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor$intercept$1.invoke(ScreenshotStepInterceptor.kt:21) at com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor$intercept$1.invoke(ScreenshotStepInterceptor.kt:21) at com.kaspersky.kaspresso.device.screenshots.ScreenshotsImpl.doTakeAndApply(ScreenshotsImpl.kt:43) at com.kaspersky.kaspresso.device.screenshots.ScreenshotsImpl.takeAndApply(ScreenshotsImpl.kt:31) at com.kaspersky.components.alluresupport.interceptors.step.ScreenshotStepInterceptor.intercept(ScreenshotStepInterceptor.kt:21) 2022-12-29 13:09:24.734 AllureLifecycle E Could not update step: step with uuid 855be471-7140-4ab6-85fd-c315329314d5 not found 2022-12-29 13:09:24.734 AllureLifecycle E Could not stop step: step with uuid 855be471-7140-4ab6-85fd-c315329314d5 not found

Failed video recording start

2022-12-29 13:23:56.489 TestRunner E java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively0(Native Method) at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317) at java.io.File.createNewFile(File.java:1008) at com.kaspersky.kaspresso.internal.extensions.other.FileExtKt.createFileIfNeeded(FileExt.kt:31) at com.kaspersky.kaspresso.files.resources.impl.DefaultResourceFilesProvider.provideVideoFile(DefaultResourceFilesProvider.kt:47) at com.kaspersky.kaspresso.files.resources.ResourceFilesProvider$DefaultImpls.provideVideoFile$default(ResourceFilesProvider.kt:11) at com.kaspersky.kaspresso.device.video.VideosImpl.record(VideosImpl.kt:15) at com.kaspersky.components.alluresupport.interceptors.testrun.VideoRecordingTestInterceptor.onTestStarted(VideoRecordingTestInterceptor.kt:13) at com.kaspersky.kaspresso.interceptors.watcher.testcase.impl.composite.TestRunCompositeWatcherInterceptor.onTestStarted(TestRunCompositeWatcherInterceptor.kt:37) at com.kaspersky.kaspresso.testcases.core.TestRunner.run(TestRunner.kt:47) at com.kaspersky.kaspresso.testcases.core.sections.MainTestSection.run(MainTestSection.kt:29) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run(BaseTestCase.kt:92) at com.kaspersky.kaspresso.testcases.api.testcase.BaseTestCase.run$default(BaseTestCase.kt:87) at com.kaspersky.kaspresso.alluresupport.sample.AllureSupportTest.counter(AllureSupportTest.kt:22) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:67) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:58) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:446) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189)

Expected behavior Video and logcat output is successfully generated.

Smartphone (please complete the following information):

  • Device: Android arm64-v8a emulator with Google APIs
  • OS: Android 10

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

That’s one of a strange emulator. Guess google just can’t publish new image without bugs. I’ll ask out my collegues with ARM macs and try to find the working image