KasperskyLab / Kaspresso

Android UI test framework
https://kasperskylab.github.io/Kaspresso/
Apache License 2.0
1.81k stars 153 forks source link

Feature Request: TestRule to record individual execution of tests #241

Closed sergio-sastre closed 3 years ago

sergio-sastre commented 3 years ago

It seems there is no TestRule on Github enabling to record individual (i.e. 1 video per test) failing and/or successful tests

Since Kaspresso can execute Adb commands via AdbServer, I was able to successfully develop a TestRule that records the execution of the tests marked by the corresponding annotation.

Although I need to test it more thoroughly with different APIs and some edge cases, I thought it could be very interesting to anybody using Kaspresso.

Pull request in the upcoming days ;)

Thanks for your work. Keep improving this awesome tool!

matzuk commented 3 years ago

Hi @sergio-sastre! Thanks a lot for your help! @eakurnikov is in progress to write special interceptors that will allow recording video, logs, and other useful stuff. Here is draft PR - https://github.com/eakurnikov/Kaspresso/pull/1 I think that there is a mind to join our efforts =)

sergio-sastre commented 3 years ago

Hi @matzuk! Glad to help if I can. I took a different approach, allowing the recording through a TestRule, independent of interceptors but relying on AdbServer though, since the recording happens through adb commands (I think it was the simplest solution).

You can find a code sample, as well as the TestRule here: https://github.com/sergio-sastre/KaspressoExperimentalRepo

What is the approach you are planning to take for the recording by using interceptors? Let me know if I can help anyhow :)

matzuk commented 3 years ago

Hi @sergio-sastre! Got it, thanks! Please, give me time to analyze your solution =) Approximate estimation - next week.

matzuk commented 3 years ago

Hi @sergio-sastre! Here some minds:

  1. In the future allure-interceptors, we are going to record a video of a test too as I mentioned earlier. The main feature comparing to using ADB is a recording of a test's video on a device! The draft is presented here. Such way promises to be more stable because ADB works not very good and may cause very interesting bugs.
  2. Also, we have plans to write more information about a test-runner that is in charge of starting tests, scheduling and orchestration them and etc. We like marathon runner, which is full of different features and that is very configurable and easy to start. One of the most interesting features - is video recording and attaching the video to Allure-report. All of this works out of the box. Just evaluate it.