06 / 10

List all Action Commands

Difficulty: 5/10
Cypress action commands, custom commands, test stability

​

These commands simulate user interactions with the application:​
  1. 1

    cy.visit(url): Navigates to a specified URL.​

  2. 2

    cy.reload(): Reloads the current page.​

  3. 3

    cy.go(direction): Navigates forward or backward in the browser history.​

  4. 4

    cy.click(): Clicks on an element.​

  5. 5

    cy.dblclick(): Double-clicks on an element.​

  6. 6

    cy.rightclick(): Right-clicks on an element.​

  7. 7

    cy.type(text): Types text into an input field.​

  8. 8

    cy.clear(): Clears the value of an input field.​

  9. 9

    cy.check() / cy.uncheck(): Checks or unchecks a checkbox or radio button.​

  10. 10

    cy.select(value): Selects an option from a dropdown.​

  11. 11

    cy.focus() / cy.blur(): Focuses or blurs an element.​

  12. 12

    cy.scrollTo(position): Scrolls the page to a specific position.​

  13. 13

    cy.trigger(event): Triggers a specific event on an element.​

Scenario Questions

0-2 years experience

  1. 1How would you use Cypress to fill out a login form and submit it using action commands?
  2. 2What happens if you chain .type() and then .click() on the same element—does Cypress wait automatically?
  3. 3If a button is disabled in the UI, how does Cypress's .click() command behave by default?

2-5 years experience

  1. 1You have a flaky test that clicks a dynamically rendered button; how would you debug why the .click() sometimes fails?
  2. 2Why might a .type() command not enter text into a React controlled input, and how would you fix it?
  3. 3Explain the trade‑offs between using .click({ force: true }) versus fixing the underlying UI issue that prevents a normal click.

5-8 years experience

  1. 1We need a reusable custom command that logs in, navigates, and sets a user preference. How would you design it to stay maintainable across many test suites?
  2. 2Discuss the performance impact of packing many action commands in a single long test versus breaking the flow into smaller, isolated tests.
  3. 3How would you ensure an action command only proceeds after a specific network request finishes, without adding arbitrary waits?

8+ years experience

  1. 1Your org is migrating from Cypress to a new framework but wants to keep existing action‑command logic. How would you plan the migration to minimize risk and duplication?
  2. 2Design a cross‑team strategy for standardizing custom action commands so that multiple product squads share a consistent library.
  3. 3What architectural considerations arise when exposing Cypress action commands as part of a shared testing library used across several services?

Follow-up Questions

  • Can you walk me through the exact steps you’d take to implement that?
  • What alternative approaches did you consider and why did you reject them?
  • How would you verify that your solution didn’t introduce new flakiness?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.