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

How I can stop recording without saving the video? #13

Closed
albka1986 opened this issue Dec 26, 2016 · 8 comments
Closed

How I can stop recording without saving the video? #13

albka1986 opened this issue Dec 26, 2016 · 8 comments

Comments

@albka1986
Copy link

albka1986 commented Dec 26, 2016

How can I stop recording without saving the video?

I want to set 2 options:

  1. if tests are failed - saving
  2. if tests are "OK" - cancel recording
@testableapple
Copy link

Not sure, that you can do it via flick.
Mb, somethink like this will help you:
killall flick

@isonic1
Copy link
Owner

isonic1 commented Dec 26, 2016

@albka1986 Yeah, @alter-al is right. You can just do a kill of the flick process or you can write some code to delete the video after the tests complete if there was not a failure.

Although, what your asking is not a bad feature to add but I'm not sure when I'd get around to adding it. I'll mark this as enhancement and will implement it at some point.

@albka1986
Copy link
Author

@alter-al, @isonic1, Thanks for the answers!

And I'he another questions:
How can I stop and save recording in Java? I have tried this code:
Runtime.getRuntime().exec("flick video -stop -p android -o \users\oleh);
But it doesn't work. I have no error and don't have any videos in the folder.
When I run start and stop commands only via terminal it's working normal.

Have you any example?

@isonic1
Copy link
Owner

isonic1 commented Dec 26, 2016

@albka1986 hmm, I'm not a java programmer so I'm not sure. Looks like you're missing a quote in ...exec("flick video -stop -p android -o \users\oleh), though.

However, if I was trying to debug this in my language I'd look for expected output so you know it's working. E.g. write or print the output of Runtime.getRuntime().exec("ls -lstr"); You should see the directory files your test runs from if that in-fact is the correct function to run system calls. If that is working then flick should run with that function too.

You can see if flick is running by doing a ps -ax | grep flick while your tests are running.

@testableapple
Copy link

@albka1986, u can use the ProcessExecutor (such as gradle/maven dependency: org.zeroturnaround:zt-exec)
For example:
List<String> commands = Arrays.asList("path/to/your/flick", "video", "-a", "stop", "-p", "android", "-n", "test");

new ProcessExecutor().command(commands).readOutput(true).execute().outputUTF8();

@isonic1
Copy link
Owner

isonic1 commented Dec 27, 2016

thanks for answering @alter-al!

@albka1986
Copy link
Author

albka1986 commented Dec 27, 2016

@alter-al, @isonic1
It's working, thanks!
But, the movie is not always saving correctly. It records 2 or 3 seconds of the test suite, while the test suite itself often lasts more than 3 minutes.

What parameter should I set if I want to record a full movie of the test?

@isonic1
Copy link
Owner

isonic1 commented Dec 27, 2016

@albka1986 it depends what platform you're saving and when you invoke the start and stop flick commands. You should set the flick start in your setup block/function/method and the flick stop in your teardown block/function/method. If you're testing android emulator or real iOS device by default it will not be the full test time but only unique images from the test run. You can override this by passing -q false in the flick stop command.

@isonic1 isonic1 closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants