0
0
Cypresstesting~5 mins

Skipping and focusing tests (.skip, .only) in Cypress - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does .skip do in Cypress tests?

.skip tells Cypress to ignore or skip a specific test or test suite during the test run. It's like telling Cypress, "Don't run this one now." This helps when you want to temporarily disable tests without deleting them.

Click to reveal answer
beginner
What is the purpose of .only in Cypress tests?

.only tells Cypress to run only the specified test or test suite and ignore all others. It's useful when you want to focus on one test to debug or develop it faster.

Click to reveal answer
beginner
How do you skip a single test in Cypress?

Use it.skip('test name', () => { ... }). This skips just that one test.

Click to reveal answer
beginner
How do you focus on a single test suite in Cypress?

Use describe.only('suite name', () => { ... }). Cypress will run only this suite and skip others.

Click to reveal answer
intermediate
What happens if multiple tests or suites have .only in Cypress?

Cypress runs all tests or suites marked with .only and skips the rest. This can help focus on multiple tests but should be used carefully to avoid missing others.

Click to reveal answer
What does it.skip() do in Cypress?
ARuns the test only
BRuns all tests
CSkips the test
DFocuses on the test
Which command runs only the specified test suite in Cypress?
Ait.only()
Bit.skip()
Cdescribe.skip()
Ddescribe.only()
If two tests have .only, what happens?
AOnly the first runs
BBoth run, others skip
CAll tests run
DTests fail to run
How do you temporarily disable a test without deleting it?
AUse <code>it.skip()</code>
BRename the test
CDelete the test
DUse <code>it.only()</code>
Which is true about .only in Cypress?
AIt runs only marked tests
BIt skips all tests
CIt runs all tests
DIt deletes tests
Explain how and why you would use .skip and .only in Cypress tests.
Think about controlling which tests run during development.
You got /4 concepts.
    Describe what happens if multiple tests or suites have .only in a Cypress test file.
    Consider how Cypress filters tests with .only.
    You got /4 concepts.