Skip to content

Cheat sheet

Cypress

Command queue, retries, intercepts, and the limits interviewers probe.

How it works

Command queue
Commands are queued and run asynchronously; do not treat them as returning values.
Retry-ability
Queries and assertions retry until timeout. Chain the assertion to the query to benefit.
Runs in the browser
Same run loop as the app, which gives speed and access to the app, with limits on multi-tab and multi-origin work.

Everyday commands

Select and assert
Prefer data attributes.
cy.get('[data-cy=submit]').click(); cy.contains('Saved').should('be.visible');
Intercept
Spy on or stub network calls and wait for them by alias.
cy.intercept('GET', '/api/items').as('items'); cy.wait('@items');
Custom commands
Wrap repeated flows like login.
Cypress.Commands.add('login', (u, p) => { /* ... */ });
cy.session
Caches and restores login state across tests.

Known limits

Multiple tabs
Not supported; stub window.open or test the target separately.
Cross-origin
Use cy.origin for flows that leave the first origin.
Browsers
Chromium family, Firefox and WebKit (experimental); check current support before claiming coverage.