0
0
Cypresstesting~5 mins

First Cypress test - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Cypress used for in software testing?
Cypress is a tool used to write and run tests that check if web applications work correctly by simulating user actions in a browser.
Click to reveal answer
beginner
What does the command cy.visit('https://example.com') do in a Cypress test?
It opens the web page at 'https://example.com' inside the test browser so Cypress can interact with it.
Click to reveal answer
beginner
In Cypress, how do you check if a page contains the text 'Welcome'?
You use cy.contains('Welcome') which looks for that text on the page and passes if found.
Click to reveal answer
intermediate
Why is it important to use clear and simple selectors in Cypress tests?
Clear selectors make tests easier to read and less likely to break if the page changes, helping tests stay reliable.
Click to reveal answer
beginner
What does the describe block do in a Cypress test file?
It groups related tests together under a common name, making the test output organized and easier to understand.
Click to reveal answer
Which Cypress command opens a web page for testing?
Acy.load()
Bcy.visit()
Ccy.open()
Dcy.start()
How do you check if a button with text 'Submit' exists on the page in Cypress?
Acy.contains('Submit')
Bcy.get('button').should('have.text', 'Submit')
Ccy.find('Submit')
Dcy.check('Submit')
What is the purpose of the it block in Cypress tests?
ATo run tests in parallel
BTo group multiple tests
CTo set up test data
DTo define a single test case
Which of these is a good practice for selecting elements in Cypress tests?
ASelecting elements by their visible text only
BUsing complex CSS selectors that may change often
CUsing data attributes like data-cy for stable selectors
DUsing XPath selectors
What will happen if an assertion in a Cypress test fails?
AThe test will stop and report failure
BThe test will restart automatically
CThe test will ignore the failure
DThe test will continue running other steps
Explain the basic structure of a Cypress test and how it runs a simple check on a web page.
Think about how you tell Cypress what page to open and what to look for.
You got /5 concepts.
    Describe why using stable selectors like data attributes is important in Cypress tests.
    Imagine if your test breaks every time the page style changes.
    You got /4 concepts.