quickstrom icon indicating copy to clipboard operation
quickstrom copied to clipboard

readyWhen for each Action

Open Skyfold opened this issue 4 years ago • 3 comments

I'm running into an issue where quickstrom has no actions to take because the previous set of actions are no longer valid and the rest of the actions cannot be taken until a network request completes. I use the readyWhen to ensure the first set of actions are valid, but after one of those actions are taken I need another "readyWhen" before the rest of the actions are valid.

Would it be possible to use the Action's css selector to determine when an action is ready and then wait if no actions can be taken at a given moment (with the same timeout as "readyWhen")? This would remove the need for the "readyWhen" as well.

Skyfold avatar May 28 '21 02:05 Skyfold

I see. This is problematic with the current design, but you can maybe work around it.

First, I just want to mention that in an upcoming version of Quickstrom (pretty much Quickstrom 2) actions will support preconditions (not just the first one with readyWhen). It's not ready yet but at least there's a good story for the future.

For now, you could maybe get away with an action sequence like this, awaiting a selector that matches when the request is done:

myNetworkAction = click "button" `followedBy` await ".request-done-somehow"

You may also use awaitWithTimeoutSecs if needed.

Does that help?

owickstrom avatar Jun 13 '21 07:06 owickstrom

@owickstrom is there any ETA on "Quickstrom 2" ?

jleonard-r7 avatar Aug 12 '21 19:08 jleonard-r7

@jleonard-r7 I wish I could give you some approximate date, but it's very hard to say. I'd really like to get it out ASAP, that's for sure. 😄

owickstrom avatar Aug 26 '21 11:08 owickstrom