Cypress interview questions — Easy

176 easy-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 easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. In the context of Cypress, cy.fixture() is best described as:

    • A. Loads static data files from the fixtures folder.correct
    • B. Finds an element containing specific text.
    • C. Sends an HTTP request directly, bypassing the UI.
    • D. Assertion syntax chained onto Cypress queries with retry-ability.

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

  2. 2. Which of the following best describes cy.viewport() in Cypress?

    • A. Executes Node.js code from within a test via the plugins process.
    • B. Changes the screen size/orientation for the test.correct
    • C. Sends an HTTP request directly, bypassing the UI.
    • D. Assertion syntax chained onto Cypress queries with retry-ability.

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

  3. 3. Which of the following best describes beforeEach hook in Cypress?

    • A. Replaces a function to control behavior and record calls.
    • B. Finds an element containing specific text.
    • C. Executes Node.js code from within a test via the plugins process.
    • D. Runs setup code before every test in the block.correct

    Why: beforeEach hook: Runs setup code before every test in the block.

  4. 4. In Cypress, what does chai assertions (.should) do or refer to?

    • A. Finds an element containing specific text.
    • B. Loads static data files from the fixtures folder.
    • C. Replaces a function to control behavior and record calls.
    • D. Assertion syntax chained onto Cypress queries with retry-ability.correct

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

  5. 5. Which of the following best describes cy.request() in Cypress?

    • A. Sends an HTTP request directly, bypassing the UI.correct
    • B. Runs setup code before every test in the block.
    • C. Queries the DOM for elements matching a selector, with retry.
    • D. Finds an element containing specific text.

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

  6. 6. Which of the following best describes cy.fixture() in Cypress?

    • A. Loads static data files from the fixtures folder.correct
    • B. Changes the screen size/orientation for the test.
    • C. Runs setup code before every test in the block.
    • D. Queries the DOM for elements matching a selector, with retry.

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

  7. 7. Which of the following best describes chai assertions (.should) in Cypress?

    • A. Config value prepended to cy.visit() paths.
    • B. Assertion syntax chained onto Cypress queries with retry-ability.correct
    • C. Replaces a function to control behavior and record calls.
    • D. Executes Node.js code from within a test via the plugins process.

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

  8. 8. Which of the following best describes cy.task() in Cypress?

    • A. Finds an element containing specific text.
    • B. Sends an HTTP request directly, bypassing the UI.
    • C. Executes Node.js code from within a test via the plugins process.correct
    • D. Loads static data files from the fixtures folder.

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

  9. 9. What is the purpose of cy.viewport() in Cypress?

    • A. Replaces a function to control behavior and record calls.
    • B. Config value prepended to cy.visit() paths.
    • C. Changes the screen size/orientation for the test.correct
    • D. Runs setup code before every test in the block.

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

  10. 10. In Cypress, what does cy.request() do or refer to?

    • A. Sends an HTTP request directly, bypassing the UI.correct
    • B. Executes Node.js code from within a test via the plugins process.
    • C. Queries the DOM for elements matching a selector, with retry.
    • D. Assertion syntax chained onto Cypress queries with retry-ability.

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

  11. 11. Which of the following best describes cy.get() in Cypress?

    • A. Sends an HTTP request directly, bypassing the UI.
    • B. Queries the DOM for elements matching a selector, with retry.correct
    • C. Config value prepended to cy.visit() paths.
    • D. Replaces a function to control behavior and record calls.

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

  12. 12. In Cypress, what does cy.viewport() do or refer to?

    • A. Assertion syntax chained onto Cypress queries with retry-ability.
    • B. Executes Node.js code from within a test via the plugins process.
    • C. Changes the screen size/orientation for the test.correct
    • D. Runs setup code before every test in the block.

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

  13. 13. What is the purpose of cy.stub() in Cypress?

    • A. Config value prepended to cy.visit() paths.
    • B. Replaces a function to control behavior and record calls.correct
    • C. Executes Node.js code from within a test via the plugins process.
    • D. Assertion syntax chained onto Cypress queries with retry-ability.

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

  14. 14. What is the purpose of beforeEach hook in Cypress?

    • A. Loads static data files from the fixtures folder.
    • B. Executes Node.js code from within a test via the plugins process.
    • C. Runs setup code before every test in the block.correct
    • D. Replaces a function to control behavior and record calls.

    Why: beforeEach hook: Runs setup code before every test in the block.

  15. 15. In Cypress, what does cy.get() do or refer to?

    • A. Queries the DOM for elements matching a selector, with retry.correct
    • B. Config value prepended to cy.visit() paths.
    • C. Finds an element containing specific text.
    • D. Sends an HTTP request directly, bypassing the UI.

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

  16. 16. What is the purpose of cy.get() in Cypress?

    • A. Queries the DOM for elements matching a selector, with retry.correct
    • B. Changes the screen size/orientation for the test.
    • C. Sends an HTTP request directly, bypassing the UI.
    • D. Runs setup code before every test in the block.

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

  17. 17. Which of the following best describes cy.contains() in Cypress?

    • A. Assertion syntax chained onto Cypress queries with retry-ability.
    • B. Finds an element containing specific text.correct
    • C. Changes the screen size/orientation for the test.
    • D. Sends an HTTP request directly, bypassing the UI.

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

  18. 18. In Cypress, what does beforeEach hook do or refer to?

    • A. Sends an HTTP request directly, bypassing the UI.
    • B. Config value prepended to cy.visit() paths.
    • C. Executes Node.js code from within a test via the plugins process.
    • D. Runs setup code before every test in the block.correct

    Why: beforeEach hook: Runs setup code before every test in the block.

  19. 19. What is the purpose of cy.request() in Cypress?

    • A. Sends an HTTP request directly, bypassing the UI.correct
    • B. Queries the DOM for elements matching a selector, with retry.
    • C. Assertion syntax chained onto Cypress queries with retry-ability.
    • D. Finds an element containing specific text.

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

  20. 20. Which of the following best describes cy.stub() in Cypress?

    • A. Config value prepended to cy.visit() paths.
    • B. Runs setup code before every test in the block.
    • C. Replaces a function to control behavior and record calls.correct
    • D. Queries the DOM for elements matching a selector, with retry.

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

Related Automation Testing topics