Testing Flashcards
7 cards from real Web Development practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Testing flashcards as text
What is 'test flakiness' in the context of automated testing?
Answer: Tests that produce inconsistent pass/fail results without code changes
Flaky tests are non-deterministic — they sometimes pass and sometimes fail on the same code, often due to timing issues or shared state.
In Cypress, what does `cy.intercept()` allow you to do?
Answer: Intercept and stub network requests made by the app under test
`cy.intercept()` lets you spy on, stub, or modify HTTP requests and responses at the network level during Cypress tests.
Which of the following best describes 'smoke testing'?
Answer: A quick set of tests to verify the most critical features work before deeper testing
Smoke testing is a shallow, fast check that the build is stable enough for further testing — it confirms core functionality works.
What does TDD (Test-Driven Development) require you to write first?
Answer: A failing test
TDD follows a red-green-refactor cycle: write a failing test first, then write the minimal code to make it pass, then refactor.
Which Playwright method waits for a network response matching a URL before resolving?
Answer: page.waitForResponse()
`page.waitForResponse()` waits until a network response matching the given URL or predicate is received, preventing race conditions.
What is the key difference between `jest.fn()` and `jest.spyOn()`?
Answer: `jest.fn()` creates a new mock function; `jest.spyOn()` wraps an existing object method
`jest.fn()` creates a standalone mock from scratch, while `jest.spyOn()` replaces an existing method on an object with a mock that can be restored.
In the context of web testing, what is a 'headless' browser?
Answer: A browser that runs without a graphical user interface
A headless browser runs without rendering a visible GUI, making it faster and suitable for automated testing in CI environments.
How this page was made: written with AI tools. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy