Cypress interview questions — Medium

353 medium-level Cypress questions from our Automation Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

Cypress appears throughout Automation Testing interviews. At medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. On a release readiness call: Why do Cypress commands rarely need explicit waits?

    • A. They never wait.
    • B. Commands auto-retry until actionable or assertions pass.correct
    • C. Animations are disabled.
    • D. It sleeps 5s each command.

    Why: Cypress auto-retries commands/assertions within a timeout.

  2. 2. "Queries the DOM for elements matching a selector, with retry" — in Cypress, this describes which of the following?

    • A. Cy.get().correct
    • B. Chai assertions (.should).
    • C. Cy.fixture().
    • D. BaseUrl.

    Why: cy.get(): Queries the DOM for elements matching a selector, with retry.

  3. 3. "Assertion syntax chained onto Cypress queries with retry-ability" — in Cypress, this describes which of the following?

    • A. Cy.get().
    • B. BaseUrl.
    • C. Cy.request().
    • D. Chai assertions (.should).correct

    Why: chai assertions (.should): Assertion syntax chained onto Cypress queries with retry-ability.

  4. 4. "Sends an HTTP request directly, bypassing the UI" — in Cypress, this describes which of the following?

    • A. Cy.fixture().
    • B. Cy.request().correct
    • C. Cy.task().
    • D. BaseUrl.

    Why: cy.request(): Sends an HTTP request directly, bypassing the UI.

  5. 5. "Replaces a function to control behavior and record calls" — in Cypress, this describes which of the following?

    • A. Cy.stub().correct
    • B. Cy.contains().
    • C. Chai assertions (.should).
    • D. Cy.task().

    Why: cy.stub(): Replaces a function to control behavior and record calls.

  6. 6. "Changes the screen size/orientation for the test" — in Cypress, this describes which of the following?

    • A. Cy.request().
    • B. BaseUrl.
    • C. BeforeEach hook.
    • D. Cy.viewport().correct

    Why: cy.viewport(): Changes the screen size/orientation for the test.

  7. 7. "Loads static data files from the fixtures folder" — in Cypress, this describes which of the following?

    • A. Cy.fixture().correct
    • B. Chai assertions (.should).
    • C. BeforeEach hook.
    • D. Cy.get().

    Why: cy.fixture(): Loads static data files from the fixtures folder.

  8. 8. "Finds an element containing specific text" — in Cypress, this describes which of the following?

    • A. Cy.viewport().
    • B. Chai assertions (.should).
    • C. Cy.stub().
    • D. Cy.contains().correct

    Why: cy.contains(): Finds an element containing specific text.

  9. 9. Which statement correctly describes Cypress?

    • A. Cypress historically runs tests in a single browser tab and has limited multi-tab support.correct
    • B. Component testing in Cypress launches the entire application backend.
    • C. Cypress executes tests over the WebDriver protocol like Selenium.
    • D. Cypress supports WebKit/Safari as fully as Chrome with no experimental flags in every version.

    Why: Multi-origin/multi-tab workflows are a known Cypress constraint.

  10. 10. Identify the accurate statement about Cypress:

    • A. Cypress executes tests over the WebDriver protocol like Selenium.
    • B. Cypress requires manual sleep() calls because it has no automatic retry.
    • C. Cypress commands are asynchronous and enqueued; they cannot be assigned to variables with normal sync code.correct
    • D. Fixtures in Cypress can only contain JavaScript code, not JSON data.

    Why: Commands run serially through a command queue managed by Cypress.

  11. 11. "Config value prepended to cy.visit() paths" — in Cypress, this describes which of the following?

    • A. Cy.task().
    • B. BaseUrl.correct
    • C. Cy.stub().
    • D. Cy.get().

    Why: baseUrl: Config value prepended to cy.visit() paths.

  12. 12. Which of the following statements about Cypress is TRUE?

    • A. Cypress supports WebKit/Safari as fully as Chrome with no experimental flags in every version.
    • B. Cypress requires manual sleep() calls because it has no automatic retry.
    • C. Fixtures in Cypress load static test data from the cypress/fixtures folder.correct
    • D. Cypress fully supports controlling multiple browser tabs simultaneously in all versions.

    Why: cy.fixture() reads JSON or other files for data-driven tests.

  13. 13. What does cy.intercept() do?

    • A. Pauses the test for debugging.
    • B. Spies on and/or stubs network requests/responses.correct
    • C. Takes a screenshot.
    • D. Switches to a new browser tab.

    Why: cy.intercept() lets you spy on, stub, or modify network requests and responses — useful for mocking APIs and asserting calls.

  14. 14. Which Cypress concept matches this description: "Executes Node.js code from within a test via the plugins process"?

    • A. Cy.request().
    • B. Cy.get().
    • C. Cy.task().correct
    • D. Cy.contains().

    Why: cy.task(): Executes Node.js code from within a test via the plugins process.

  15. 15. In the context of Cypress, which of the following is a correct statement?

    • A. Cypress fully supports controlling multiple browser tabs simultaneously in all versions.
    • B. Cypress Test Replay / Cloud can record runs for debugging and parallelization.correct
    • C. Component testing in Cypress launches the entire application backend.
    • D. Cypress supports WebKit/Safari as fully as Chrome with no experimental flags in every version.

    Why: Cypress Cloud adds recording, analytics, and parallel orchestration.

  16. 16. In Cypress, which of the following is described as: "Queries the DOM for elements matching a selector, with retry"?

    • A. Cy.viewport().
    • B. Cy.stub().
    • C. Cy.get().correct
    • D. Cy.task().

    Why: cy.get(): Queries the DOM for elements matching a selector, with retry.

  17. 17. In Cypress, which of the following is described as: "Replaces a function to control behavior and record calls"?

    • A. Cy.fixture().
    • B. Cy.stub().correct
    • C. Cy.contains().
    • D. Cy.viewport().

    Why: cy.stub(): Replaces a function to control behavior and record calls.

  18. 18. In Cypress, which of the following is described as: "Loads static data files from the fixtures folder"?

    • A. Cy.fixture().correct
    • B. Cy.stub().
    • C. Cy.task().
    • D. Cy.get().

    Why: cy.fixture(): Loads static data files from the fixtures folder.

  19. 19. In Cypress, which of the following is described as: "Executes Node.js code from within a test via the plugins process"?

    • A. BeforeEach hook.
    • B. Cy.task().correct
    • C. Cy.request().
    • D. BaseUrl.

    Why: cy.task(): Executes Node.js code from within a test via the plugins process.

  20. 20. In Cypress, which of the following is described as: "Changes the screen size/orientation for the test"?

    • A. Cy.viewport().correct
    • B. Cy.get().
    • C. Cy.fixture().
    • D. BaseUrl.

    Why: cy.viewport(): Changes the screen size/orientation for the test.

Related Automation Testing topics