Project

General

Profile

Actions

action #125378

closed

action #125300: Support creating demo videos with pauses and mouse moving

[timeboxed:20h] Proof of concept for supporting creating demo videos with pauses and mouse moving size:M

Added by tinita over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2023-03-02
Due date:
2023-03-24
% Done:

0%

Estimated time:

Description

Motivation

Additionally to testing, openQA can be used to create demonstration videos, and ideally the same
test code can be used, just that there should be certain pauses, and we would want to see the mouse
moving and have a little pause before clicking.

Testing of course still has the higher priotity, and the os-autoinst code should not get more
complicated, but for creating simple demo videos we probably don't need much new code.

Acceptance criteria

  • AC1: A PR for showing a demo mode exists and is enabled via a setting like DEMO_MODE, which can be used for videos targeted at human beings learning about something

Suggestions

  • Provide an easy way to delay/sleep around needle matches (assuming this is usually what a user would want to take a look at)
  • Move the mouse pointer gradually rather than instantaneously
Actions #1

Updated by tinita over 1 year ago

  • Parent task set to #125300
Actions #2

Updated by tinita over 1 year ago

  • Status changed from New to In Progress

Since I did that for the Perl Workshop, here is a first suggestion: https://github.com/os-autoinst/os-autoinst/pull/2274

We would need more sleep calls in various occasions I guess, but that can be also done later.

Test and needles:

Actions #3

Updated by tinita over 1 year ago

  • Status changed from In Progress to Feedback

I updated the https://github.com/perlpunk/openqa-simple-starter readme with a link to the example video and a short usage.
I updated the PR https://github.com/os-autoinst/os-autoinst/pull/2274 with the suggestions from Marius.

Actions #4

Updated by okurz over 1 year ago

  • Due date changed from 2023-03-17 to 2023-03-24

discussed in daily 2023-03-21. We should be able to resolve this ticket this week

Actions #5

Updated by livdywan over 1 year ago

  • Subject changed from [timeboxed:20h] Proof of concept for supporting creating demo videos with pauses and mouse moving to [timeboxed:20h] Proof of concept for supporting creating demo videos with pauses and mouse moving size:M
Actions #6

Updated by tinita over 1 year ago

  • Status changed from Feedback to Resolved

I looked through the testapi functions for what we would have to do for a simple demo mode.
Only a few functions would need to be adjusted IMHO, because I imagine that if a user writes a test that is supposed
to be run in demo mode, then they might want to decide themselves where to put a sleep.

Optionally add a factor for the default demo mode sleep amount.

Functions to be adjusted

type_string

set a default delay in demo mode

assert_and_click

  • sleep 1s by defaut after needle match before clicking
  • Alternatively let people specify a callback to execute after needle match

See also assert_and_dclick

assert_screen, check_screen

Add a sleep after the needle match by default, but let people configure it because it might not always be wanted here.
Or also add a callback.

send_key

I can imagine that it could be useful to show a little popup in case a key or key combination is pressed, for example pressing ctrl-f5 to close some window can be unexpected

New functions

It might not be a good idea to change all existing functions.

mouse_move

Will move the mouse slowly from the current position (or optionally from the
specified position) to the new position

mouse_drag_move

mouse_drag is simply implemented by setting the mouse to the new position
after clicking. Either add a new option or add a new function that will slowly
move the mouse

sleep or demosleep

Will sleep $long seconds in demo mode, and if defined, $short seconds in normal mode.

sub demosleep ($long, $short) {
    sleep $long && return if get_var('DEMO_MODE');
    sleep $short if defined $short;
}
  • function to get last match coordinates

When playing with assert_and_click, I found out that there is no way
for testapi users to get the position of the last needle match (except the
undocumented way of accessing the global package vars).
That would have avoided having to change assert_and_click; I could
have just used assert_screen; (x,y) get_match_position; mouse_move(x,y).

Actions

Also available in: Atom PDF