Why does Cypress fail to resolve async calls using await in headless mode, even though Cypress promises work in open mode?

Yeah, this is a pretty common problem, especially when running in CI or headless mode where timing is much more sensitive. Since Cypress doesn’t behave like native JavaScript here, it struggles to track async calls outside its internal command chain.

This can cause issues like tests finishing prematurely before all commands are executed. What helped me was entirely switching to using Cypress’s own commands without mixing in native await.

I stuck with .then() to control flow, even though it seemed redundant at first. If you want to keep things clean, you can also create custom commands to simplify this nesting logic. It really makes the test more reliable overall, especially in headless mode