This example attempts to demonstrate some confusing situations users may encounter based on the current async await proposal.
In each example I also list out the command queue and the execution order of the each statement.
-
now.jsdemonstrates how are things currently. -
withProposedAwait.jsdemonstrates how things would be with the new proposed await -
awaitAllTheThings.jsdemonstrates how things would change if we required all cypress commands to be awaited.
I know there are also query vs assertion / retry-ability concerns in here to but these examples focus on execution order.
Largely my concern is that the intersection of the command queue and the await command will be too confusing for users to reason about without significant knowledge of how the command queue works.
I think requiring awaiting all the cy commands would actually resolve that, but i think that runs into retry-ability problems.
Let me try and address why I'm not concerned about these confusions.
Let's replace the example with promises.