Cypress Interview Questions and answers

What browsers are supported by cypress?

It supports chrome, edge, electron, firefox

What is time travel - snapshots after every step?

Explain Architecture

No servers involved and uses devtools protocol

How to install Cypress

  • Install nodejs, vscode
  • npm i cypress
  • npx cypress open
  • npx cypress run

How to use stubs and spies

Organizing tests

  • How to write tests in cypress
  • How to group tests in cypress
  • How to organize/structure tests in cypress

How to debug

How to run tests

  • cypress run --browser chrome, chromium, edge, electron, firefox
  • cypress run --config-file cypress.json
  • cypress run --env host=api.dev.local,port=4222
  • cypress run --headed
  • cypress run --headed --no-exit
  • cypress run --record --parallel

How to access/get baseurl in cypress

Assertions in Cypress

  • How to assert text in cypress
  • How to check if element is visible in cypress - to be visible in cypress
  • to be equal in cypress
  • to be false in cypress
  • How to fail test in cypress
  • How to check if button is disabled in cypress
  • How to check if element exists in cypress
  • How to check if element does not exist in cypress
  • How to check if element is not visible in cypress
  • to deep equal in cypress
  • to match in cypress
  • to match regex in cypress
  • to not contain in cypress
  • to not exist in cypress
  • not to be empty in cypress
  • not to equal in cypress

Run specific tests - test filters

  • How to run a single test in cypress
  • How to run only one test in cypress
  • How to run tests in parallel in cypress
  • How to run a specific test in cypress
  • How to disable or ignore test in cypress
  • How to skip test in cypress
  • Run failed tests
  • How to pause test in cypress
  • How to end test

How to get data from web page?

  • How to get text from element in cypress
  • How to get attribute value in cypress
  • How to get second element in cypress
  • How to get current url in cypress
  • How to get element in cypress
  • How to get baseurl in cypress
  • How to get current date in cypress
  • How to get value from element in cypress
  • How to get input value in cypress
  • How to check if checkbox is checked in cypress
  • How to check if element is disabled in cypress
  • How to get class name in cypress
  • How to validate text in cypress
  • How to return value in cypress
  • How to get value from element in cypress
  • How to get attribute value in cypress
  • How to get input value in cypress
  • How to get href value in cypress
  • How to get attribute value in cypress

How to mock api response in cypress

GUI Interactions

  • How to check a checkbox in cypress
  • How to click a button in cypress
  • How to count elements in cypress
  • How to double click in cypress
  • How to drag and drop in cypress
  • How to select value from a dropdown in cypress
  • How to select option in cypress
  • How to clear input in cypress
  • How to scroll down in cypress
  • scroll to view in cypress
  • How to enter text in cypress
  • How to clear input in cypress
  • How to click on a link in cypress
  • How to select the second element in cypress
  • How to type in cypress

How to bypass login in cypress

Pressing keys

  • Press special keys
  • How to backspace in cypress
  • How to press enter in cypress

How to clear cache in cypress

How to check url in cypress

logging

  • How to console log in cypress or How to print to console in cypress
  • How to log to console in cypress
  • How to log object in cypress
  • log to terminal in cypress
  • -log-to-output in cypress

Finding Element or Element Identification

  • How to identify elements in cypress
  • How to get element by text in cypress
  • How to find element by text in cypress
  • How to get first element in cypress

Waiting and synch

  • How to wait for page load in cypress
  • How to wait for response in cypress
  • How to wait for xhr in cypress
  • How to wait for page load in cypress
  • How to wait for response in cypress
  • How to wait for xhr in cypress
  • How to wait for animation in cypress
  • How to avoid wait in cypress
  • What is automatic waits

How to throw error in cypress

How to upload file in cypress

Download a file

How to test file download in cypress

How to hover in cypress

How to handle redirects in cypress

json data

  • How to read json file in cypress
  • write to json file in cypress
  • csv to json in cypress
  • excel to json in cypress

How to run jquery commands in cypress

How to integrate cypress tests with Jenkins

Jmeter tests in cypress

Migrate javascript project to typescript in cypress

navigate to url in cypress

switch to new window in cypress

How to press tab in cypress

How to refresh page in cypress

queryselector in cypress

How to return value in cypress

cookies

  • How to set cookies in cypress
  • How to preserve cookies in cypress

How to throw error in cypress

How to use fixtures in cypress

Custom Commands

How to use custom commands in cypress

How to update snapshots in cypress

How to use xpath in cypress

How to use force true in cypress

How to record video in cypress

xvfb in cypress

zephyr integration in cypress



                    
Complex problems, Simple Solutions