SoftwareTestPilot
28 Cypress Q&A

Cypress Interview Questions & Answers (1970)

28 real Cypress interview questions with senior-QA answers — architecture, retry-ability, cy.get vs cy.find, cy.intercept, fixtures, custom commands, cy.session, cy.origin, headless runs, parallelization, and GitHub Actions CI.

  • 3 min read
  • Difficulty: Mixed (Easy → Medium)
  • Freshers → 5+ yrs
  • Updated July 1970
  • Avinash Kamble

1. Cypress Basics

Easy Very Common 1 min read

Q1.What is Cypress?

Cypress is an open-source JavaScript end-to-end testing framework that runs directly inside the browser. It's known for its time-travel debugger, automatic waiting, and developer-friendly API.

Medium Very Common 1 min read

Q2.How is Cypress architecturally different from Selenium?

Selenium drives the browser from outside via WebDriver. Cypress runs inside the browser in the same event loop as your app — giving it native access to the DOM, network, and storage, but limiting it to a single browser tab and same-origin (until cy.origin()).

Medium Very Common 1 min read

Q3.How do you install Cypress?

npm init -y
npm install --save-dev cypress
npx cypress open
Medium Very Common 1 min read

Q4.What are the main components of Cypress?

  • Test Runner (interactive GUI)
  • Command API (cy.*)
  • Fixtures folder
  • Support & Plugins files
  • cypress.config.ts
  • Cypress Cloud (dashboard, parallelization, flake detection)
Medium Very Common 1 min read

Q5.What is the difference between cy.get() and cy.find()?

cy.get(selector) queries from the document root. cy.find(selector) is chained on an existing subject and queries only that subject's descendants:

cy.get('.cart').find('.item'); // items INSIDE the cart only
Confidence check

If you can confidently answer the Cypress Basics questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

2. Commands, Chaining & Retry

Medium Very Common 1 min read

Q6.What is Cypress's automatic retry-ability?

Most cy.* commands and every assertion re-run automatically until they pass or the command times out (default 4s). You almost never need cy.wait(ms).

Medium Very Common 1 min read

Q7.cy.wait() — when is it acceptable?

Only for waiting on a specific network alias:

cy.intercept('POST', '/api/orders').as('createOrder');
cy.get('[data-test="submit"]').click();
cy.wait('@createOrder').its('response.statusCode').should('eq', 201);

Never use cy.wait(2000) — it's a flake magnet.

Medium Very Common 1 min read

Q8.How does chaining work in Cypress?

cy.get('.list li').first().should('contain', 'Apples').click();

Each command yields a subject to the next. Assertions retry the whole chain.

Medium Very Common 1 min read

Q9.How do you write an assertion?

cy.get('[data-test="total"]').should('have.text', '$42.00');
cy.url().should('include', '/checkout');
cy.get('.error').should('not.exist');
Medium Very Common 1 min read

Q10.How do you handle text input and forms?

cy.get('[data-test="email"]').type('qa@example.com');
cy.get('[data-test="pwd"]').type('secret{enter}');
Medium Very Common 1 min read

Q11.How do you visit a page and set a baseUrl?

// cypress.config.ts
export default defineConfig({
  e2e: { baseUrl: 'https://qa.example.com' },
});
// spec
cy.visit('/login');
Medium Common 1 min read

Q12.How do you deal with alerts / confirms / prompts?

Cypress auto-accepts them. To assert, stub the window method:

cy.on('window:confirm', (msg) => {
  expect(msg).to.eq('Delete order?');
  return true;
});
Confidence check

If you can confidently answer the Commands, Chaining & Retry questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

3. Network Stubbing & Fixtures

Medium Common 1 min read

Q13.What is cy.intercept()?

The modern network-stubbing API. Match by method + URL and either spy, stub, or delay:

cy.intercept('GET', '/api/users', { fixture: 'users.json' }).as('users');
Medium Common 1 min read

Q14.cy.intercept vs cy.route — which should I use?

Use cy.intercept. cy.route is deprecated since Cypress 6 and doesn't handle fetch/XHR uniformly.

Medium Common 1 min read

Q15.How do you use fixtures?

// cypress/fixtures/users.json — { "id": 1, "email": "qa@x.com" }
cy.fixture('users').then((u) => {
  cy.intercept('GET', '/api/users/1', u);
});
Medium Common 1 min read

Q16.How do you stub a slow response?

cy.intercept('GET', '/api/slow', (req) => {
  req.reply({ delay: 3000, body: { ok: true } });
});
Medium Common 1 min read

Q17.How do you assert on network calls?

cy.wait('@createOrder').then(({ request, response }) => {
  expect(request.body).to.include({ items: 3 });
  expect(response.statusCode).to.eq(201);
});
Confidence check

If you can confidently answer the Network Stubbing & Fixtures questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

4. Custom Commands & Plugins

Medium Common 1 min read

Q18.What is a custom command?

// cypress/support/commands.js
Cypress.Commands.add('login', (email, pwd) => {
  cy.request('POST', '/api/login', { email, pwd })
    .then(({ body }) => window.localStorage.setItem('token', body.token));
});
// spec
cy.login('qa@x.com', 'secret');
Medium Common 1 min read

Q19.How do you handle authentication efficiently?

Log in via cy.request() or cy.session() to skip the UI login flow on every test:

beforeEach(() => {
  cy.session('qa-user', () => {
    cy.request('POST', '/api/login', creds)
      .its('body.token').then((t) => localStorage.setItem('token', t));
  });
});
Medium Common 1 min read

Q20.What is cy.origin() used for?

Running commands against a different origin (needed for third-party OAuth pages, Auth0, Okta, Google sign-in). Enable with experimentalOriginDependencies and wrap the cross-origin block.

Medium Occasional 1 min read

Q21.What are Cypress plugins?

Node-side extensions loaded in cypress.config.ts → setupNodeEvents. Used for DB seeding, file preprocessors, image diffing, coverage collection, and custom tasks (cy.task()).

Medium Occasional 1 min read

Q22.How do you handle file uploads?

cy.get('input[type="file"]').selectFile('cypress/fixtures/avatar.png');
Confidence check

If you can confidently answer the Custom Commands & Plugins questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

5. CI/CD, Dashboard & Real-World

Medium Occasional 1 min read

Q23.How do you take a screenshot on failure?

Built-in — Cypress screenshots + videos every failing test by default. Configure via cypress.config.ts:

screenshotOnRunFailure: true,
video: true,
Medium Occasional 1 min read

Q24.How do you run tests in headless mode?

npx cypress run --browser chrome --headless
# specific spec
npx cypress run --spec cypress/e2e/login.cy.ts
Medium Occasional 1 min read

Q25.How do you parallelize Cypress runs?

Use Cypress Cloud: cypress run --record --parallel --key <key>. Free open-source alt: sorry-cypress (self-hosted).

Medium Occasional 1 min read

Q26.How do you integrate Cypress with GitHub Actions?

- uses: cypress-io/github-action@v6
  with:
    browser: chrome
    record: true
    parallel: true
  env:
    CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Medium Occasional 1 min read

Q27.What are Cypress's known limitations?

  • Single browser at a time (no true multi-tab/window)
  • JavaScript/TypeScript only
  • Limited iframe support without cy.origin
  • No native mobile automation (use Appium)
Easy Occasional 1 min read

Q28.Cypress vs Playwright — which should I pick for a new project?

Playwright wins for cross-browser, multi-tab, mobile emulation, parallel-by-default. Cypress wins for the interactive time-travel runner and the mature dashboard. See our Cypress vs Playwright comparison. Also related: Cypress for Freshers and Cypress at 5 YOE.

Confidence check

If you can confidently answer the CI/CD, Dashboard & Real-World questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

Quick revision

  1. Q1: What is Cypress — Cypress is an open-source JavaScript end-to-end testing framework that runs directly inside the browser.
  2. Q2: How is Cypress architecturally different from Selenium — Selenium drives the browser from outside via WebDriver.
  3. Q3: How do you install Cypress — npm init -y npm install --save-dev cypress npx cypress open
  4. Q4: What are the main components of Cypress — Test Runner (interactive GUI) Command API ( cy.* ) Fixtures folder Support & Plugins files cypress.config.ts Cypress Cloud (dashboard, parallelization, flake detection)
  5. Q5: What is the difference between cy.get() and cy.find() — cy.get(selector) queries from the document root.

Frequently asked questions

Yes — Cypress is still one of the top 3 E2E frameworks in QA job posts, especially in JavaScript/React-heavy shops. Playwright has taken share but Cypress remains a household name.

Learn Playwright first if you have a choice — broader browser and language support, better parallelism. Learn Cypress first if your target company's stack already uses it.

Yes — Cypress is JS/TS-only. Basic ES6, promises, and async patterns are enough to be productive.

Point Cypress at Cypress's official example app (cypress-realworld-app) or saucedemo.com. Then rehearse with our AI Mock Interview.

Was this article helpful?

Cluster · QA Career

More from QA Interview Questions

Behavioral, framework, coding — full interview prep.

Pillar guide · 10 articles
More in this cluster
From the QA Career pillar

Key takeaways

  • Master the fundamentals before tackling advanced Cypress scenarios.
  • Always explain trade-offs — interviewers reward judgement, not memorisation.
  • Use real project examples; generic answers blend in.
  • Practice answers out loud — written prep doesn't transfer to live rounds.
  • Revise the 30-second cheat sheet the night before your interview.
  • Keep one strong scenario story ready for every section above.

These Questions Are Just the Start

Get 1000+ more with detailed model answers in our QA Interview Preparation Kit. Covers manual testing, automation, API, SQL, Selenium, Playwright, and framework concepts — everything asked in real QA interviews.

Get Interview Kit — ₹1,045

Cypress jobs hiring now

Live, indexable Cypress openings — updated daily in Jobs Radar.

Browse all QA jobs on Jobs Radar

Loading current openings…

Home