Await Cypress Command Results @gleb
Await Cypress Command Results  @gleb
Uploaded August 2023 | Updated November 2026, 14 minutes ago
It would be really cool if one could write something like this in Cypress specs using the "await" syntax to get the results:
await cy.visit('/')
const n = await cy.get('#projects-count').invoke('text').then(parseInt)
cy.log(n)
expect(n, 'number of projects').to.be.within(350, 400)
Now it is possible. I will publish the code later. If you want to stay tuned, subscribe to this youtube channel and to my monthly newsletter at cypresstips.substack.com The code for this video is in github.com/bahmutov/cy-await but this is very very very ALPHA
Await Cypress Command Resultslast-of-type And first-of-type CSS Selectors ExamplesAccumulator And Cypress-Recurse PluginCheck N CheckboxesFilter Elements And Items With RetriesConditional DetailsThe Difference Between Cypress Commands cy.find And cy.filterCustom Cypress HTML Should Look AssertionConditional Count Elements After They Have Been LoadedCompare Two Lists Of Elements ExamplesRequired Input AttributesTest Element Overflow Using A Custom Cypress Chai Assertion
gleb bahmutov |

Await Cypress Command Results

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER