Skip to content
SDETRole
SDETRole

Interview questions / UI Automation

Cypress Interview Questions

Cypress has its own execution model: commands are queued, not awaited. Interviewers probe that model, plus network stubbing and test isolation.

5 questions · 1 beginner· 3 intermediate· 1 advanced

beginner questions

intermediate questions

advanced questions

Why Cypress questions are different

Cypress runs inside the browser alongside your application, while Selenium and Playwright drive the browser from outside through a protocol. That architectural choice explains most Cypress behaviour, and interviewers use it to separate people who have read the API from people who understand it. Expect to be asked how Cypress differs from Selenium, what the trade-offs are (fast feedback and automatic retries, but historically limited multi-tab and cross-origin support), and when you would choose it.

The command queue: the question everyone gets

Cypress commands are not promises. cy.get('[data-cy=total]') does not find anything when it is called; it adds a command to a queue that Cypress runs later, retrying queries and assertions until they pass or time out. That is why const el = await cy.get(...) does not work and why async/await is not supported for Cypress commands. Values are passed along the chain instead:

  • cy.get('[data-cy=total]').should('have.text', '$42.00') retries the query and the assertion together.
  • .then((el) => …) gives you the yielded value, but code inside .then does not retry.
  • Aliases (.as('total')) share values between commands; cy.wrap() brings a real promise into the queue.

Cypress commands and patterns to know

What a strong Cypress answer sounds like

When asked how to wait for data to load, a weak answer is cy.wait(3000). A strong one registers cy.intercept('GET', '/api/orders').as('orders') before visiting the page, waits with cy.wait('@orders'), asserts on the response status, and then lets a retrying assertion such as cy.get('[data-cy=order-row]').should('have.length', 3) confirm the UI. The answer shows that you know which Cypress commands retry and that synchronisation should be tied to an event, not a duration.

Interviewers also like to hear why data-cy or data-testid attributes are recommended for selectors in Cypress projects: they are stable through styling changes and make the test intent clear, although user-facing text and roles are still worth asserting on.

How to prepare

SDETRole does not have a Cypress lab yet. Read the Cypress basics lesson, work through the questions above, and practise the transferable skills (choosing user-facing locators, writing retrying assertions, synchronising on network calls) in the Playwright practice lab, whose challenges check that your selectors and assertions really work. The automation tool comparison lesson helps with the "why Cypress?" question.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →