lecture 8 of 190 completed

How Cypress actually runs

Why cy commands are not promises, what the command queue is, and why you chain instead of using await.

What you'll learn

  • Why cy commands do not behave like ordinary JavaScript
  • What the command queue is, and why you chain instead of await
  • The two beginner mistakes that come from ignoring it

You have now written tests that find elements, click them, and check the result. Everything worked, but one thing about the code was never explained: Cypress does not run your commands the way ordinary JavaScript runs.

That difference explains several things you may have already wondered about, and it is where a common beginner mistake comes from.

Here is the surprise. This code looks like it finds an element:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →