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

Add speed option for actions #865

Closed
AlexanderMoskovkin opened this issue Oct 12, 2016 · 20 comments
Closed

Add speed option for actions #865

AlexanderMoskovkin opened this issue Oct 12, 2016 · 20 comments
Assignees
Labels
API MODIFICATION LEVEL: non-breaking changes AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API SYSTEM: automations TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

AlexanderMoskovkin commented Oct 12, 2016

Proposal

This affects to delay between action parts (for example between mousedown and mouseup in click, or between each symbol typing in typeText), to the cursor speed. This option you can use if you need to emulate human-behavior (it can be useful for cases when your scripts work properly only if you do actions no too fast).

Now we have the following options: Mouse Action Options, Click Action Options, Typing Action Options.
I suppose it should be a new type of options:

Action Options: { speed: <number> }

Mouse, Click and Typing options extend it.
So, we add options argument to Select Text, Type Text and Press Key actions.

Multiply

If the test run speed options is set to some value1 and action option is set to the value2 - it will be multiplied and the action will be executing with speed value1 * value2

@inikulin
Copy link
Contributor

Note that factors should multiply, so if we have 0.5 set in test controller and 0.5 for action the resulting speed should be 0.25

@inikulin
Copy link
Contributor

Also I guess it should be between 0.1 and 1

@inikulin inikulin added this to the Planned features milestone Oct 12, 2016
@AlexanderMoskovkin AlexanderMoskovkin modified the milestones: Sprint #1, Planned features Oct 18, 2016
@AlexanderMoskovkin
Copy link
Contributor Author

AlexanderMoskovkin commented Oct 20, 2016

I've updated the first post with the feature proposal. What do you think about it?

\cc @inikulin @VasilyStrelyaev @DevExpress/testcafe

@inikulin
Copy link
Contributor

@AlexanderMoskovkin I don't think we need test controller option. There should be CLI and programmatical API option. Also, min value should be 0.01

@georgiy-abbasov
Copy link
Contributor

georgiy-abbasov commented Oct 20, 2016

Multiply

Imho, there should be action speed option priority upon testController speed option and they should be independent.
Is possible a scenario where all actions are slow and one should be executed quickly ? :

test `my test` (async t => {
    t.speed = 0.5;
    // ... bunch of slow actions
    await t.click({ speed: 1 });
    // ... bunch of slow actions
});

@helen-dikareva
Copy link
Collaborator

I don't really like idea to multiply factors. May be just use speed factor specified for action, if we don't have it - use factor specified for test controller.

@helen-dikareva
Copy link
Collaborator

By default it will be slow mode? speed === 1?

@AlexanderMoskovkin
Copy link
Contributor Author

AlexanderMoskovkin commented Oct 20, 2016

By default it will be slow mode? speed === 1

1 - fast, 0.01 - slow

@helen-dikareva
Copy link
Collaborator

Sure, sorry

@AlexanderMoskovkin
Copy link
Contributor Author

I don't think we need test controller option. There should be CLI and programmatical API option.

Yes, I'm agree

@kirovboris
Copy link
Collaborator

I think the speed option for one action is almost useless, because it's hard to support and requires to much attention for separate actions. It's almost the same as random placed t.wait actions. In my opinion, the speed option is usefull, when i want to make slower test if it's requires more time between actions or to see what's going on at during test time.

@miherlosev
Copy link
Collaborator

I don't like idea to multiply factors too.

@AlexanderMoskovkin
Copy link
Contributor Author

I think the speed option for one action is almost useless

For example some ASPx controls doesn't work properly when you type (or click, dblclick, drag) too fast like a robot (some script expect human-behavior with some delays between actions) . With this option you can run only several actions in slow mode but run the others fast (it will decrease tests duration)

@AlexanderMoskovkin
Copy link
Contributor Author

Is possible a scenario where all actions are slow and one should be executed quickly ?

Can you give a real case when this may be useful. I can't

@AlexanderMoskovkin
Copy link
Contributor Author

Ok, it was discussed in private, I'll update the top post a little later

@VasilyStrelyaev
Copy link
Collaborator

I'll update the top post a little later

@AlexanderMoskovkin Taking into account the discussion, the top post doesn't seem to be up-to-date yet. Have you already decided on all the things? Can you pls update it?

@AlexanderMoskovkin
Copy link
Contributor Author

Have you already decided on all the things?

Not yet. I'll notify you

@AlexanderMoskovkin
Copy link
Contributor Author

I've updated the top post. Here describes api changes. /cc @inikulin @VasilyStrelyaev

@sirgallifrey
Copy link

+1 to having ability to delay or speed up certain actions.

@inikulin inikulin modified the milestones: Sprint #4, Planned features Jan 26, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Feb 10, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Feb 10, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Feb 13, 2017
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
* Add `speed` option for actions (closes DevExpress#865)

* Fix tests

* Fix error message

* Fix type aciton after rebase

* Fix pressKey test

* Changes for legacy-api
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API MODIFICATION LEVEL: non-breaking changes AREA: client AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API SYSTEM: automations TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

8 participants