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. Why do Cypress commands rarely need explicit waits?
- A. They run synchronously and never wait.
- B. Commands automatically retry/await until elements are actionable or assertions pass (within a timeout).correct
- C. Cypress disables animations globally.
- D. It sleeps 5 seconds before every command.
Why: Cypress commands and assertions auto-retry until they pass or the command times out, so fixed sleeps are usually unnecessary.
2. In the context of Cypress, cy.request() is best described as:
- A. Changes the screen size/orientation for the test.
- B. Sends an HTTP request directly, bypassing the UI.correct
- C. Assertion syntax chained onto Cypress queries with retry-ability.
- D. Executes Node.js code from within a test via the plugins process.
Why: cy.request(): Sends an HTTP request directly, bypassing the UI.
3. 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.
4. 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.
5. Which of the following best describes chai assertions (.should) in Cypress?
- A. Changes the screen size/orientation for the test.
- B. Assertion syntax chained onto Cypress queries with retry-ability.correct
- C. Config value prepended to cy.visit() paths.
- D. Sends an HTTP request directly, bypassing the UI.
Why: chai assertions (.should): Assertion syntax chained onto Cypress queries with retry-ability.
6. In Cypress, what does chai assertions (.should) do or refer to?
- A. Runs setup code before every test in the block.
- B. Sends an HTTP request directly, bypassing the UI.
- C. Assertion syntax chained onto Cypress queries with retry-ability.correct
- D. Loads static data files from the fixtures folder.
Why: chai assertions (.should): Assertion syntax chained onto Cypress queries with retry-ability.
7. Which of the following best describes cy.viewport() in Cypress?
- A. Runs setup code before every test in the block.
- B. Loads static data files from the fixtures folder.
- C. Executes Node.js code from within a test via the plugins process.
- D. Changes the screen size/orientation for the test.correct
Why: cy.viewport(): Changes the screen size/orientation for the test.
8. Which of the following best describes cy.request() in Cypress?
- A. Queries the DOM for elements matching a selector, with retry.
- B. Assertion syntax chained onto Cypress queries with retry-ability.
- C. Sends an HTTP request directly, bypassing the UI.correct
- D. Finds an element containing specific text.
Why: cy.request(): Sends an HTTP request directly, bypassing the UI.
9. During a code review, a reviewer asks: What does cy.intercept() do?
- A. Pauses the test.
- B. Spies on/stubs network requests.correct
- C. Takes a screenshot.
- D. Opens a new tab.
Why: cy.intercept() spies on, stubs, or modifies network traffic.
10. In Cypress, what does cy.viewport() do or refer to?
- A. Assertion syntax chained onto Cypress queries with retry-ability.
- B. Changes the screen size/orientation for the test.correct
- C. Sends an HTTP request directly, bypassing the UI.
- D. Loads static data files from the fixtures folder.
Why: cy.viewport(): Changes the screen size/orientation for the test.
11. What is the purpose of beforeEach hook in Cypress?
- A. Runs setup code before every test in the block.correct
- B. Finds an element containing specific text.
- C. Changes the screen size/orientation for the test.
- D. Sends an HTTP request directly, bypassing the UI.
Why: beforeEach hook: Runs setup code before every test in the block.
12. Which of the following best describes cy.stub() in Cypress?
- A. Sends an HTTP request directly, bypassing the UI.
- B. Replaces a function to control behavior and record calls.correct
- C. Runs setup code before every test in the block.
- D. Loads static data files from the fixtures folder.
Why: cy.stub(): Replaces a function to control behavior and record calls.
13. In Cypress, what does cy.request() do or refer to?
- A. Loads static data files from the fixtures folder.
- B. Executes Node.js code from within a test via the plugins process.
- C. Config value prepended to cy.visit() paths.
- D. Sends an HTTP request directly, bypassing the UI.correct
Why: cy.request(): Sends an HTTP request directly, bypassing the UI.
14. What is the purpose of cy.request() in Cypress?
- A. Changes the screen size/orientation for the test.
- B. Sends an HTTP request directly, bypassing the UI.correct
- C. Config value prepended to cy.visit() paths.
- D. Replaces a function to control behavior and record calls.
Why: cy.request(): Sends an HTTP request directly, bypassing the UI.
15. What is the purpose of 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. Loads static data files from the fixtures folder.
- D. Replaces a function to control behavior and record calls.
Why: cy.viewport(): Changes the screen size/orientation for the test.
16. What is the purpose of cy.stub() in Cypress?
- A. Assertion syntax chained onto Cypress queries with retry-ability.
- B. Replaces a function to control behavior and record calls.correct
- C. Config value prepended to cy.visit() paths.
- D. Queries the DOM for elements matching a selector, with retry.
Why: cy.stub(): Replaces a function to control behavior and record calls.
17. Which of the following best describes cy.contains() in Cypress?
- A. Changes the screen size/orientation for the test.
- B. Runs setup code before every test in the block.
- C. Replaces a function to control behavior and record calls.
- D. Finds an element containing specific text.correct
Why: cy.contains(): Finds an element containing specific text.
18. Which of the following best describes cy.get() in Cypress?
- A. Queries the DOM for elements matching a selector, with retry.correct
- B. Loads static data files from the fixtures folder.
- C. Changes the screen size/orientation for the test.
- D. Config value prepended to cy.visit() paths.
Why: cy.get(): Queries the DOM for elements matching a selector, with retry.
19. In Cypress, what does cy.get() do or refer to?
- A. Queries the DOM for elements matching a selector, with retry.correct
- B. Sends an HTTP request directly, bypassing the UI.
- C. Assertion syntax chained onto Cypress queries with retry-ability.
- D. Replaces a function to control behavior and record calls.
Why: cy.get(): Queries the DOM for elements matching a selector, with retry.
20. Which of the following best describes cy.task() in Cypress?
- A. Executes Node.js code from within a test via the plugins process.correct
- B. Sends an HTTP request directly, bypassing the UI.
- C. Loads static data files from the fixtures folder.
- D. Replaces a function to control behavior and record calls.
Why: cy.task(): Executes Node.js code from within a test via the plugins process.