Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to skip this test in Cypress.
Cypress
it[1]('should not run this test', () => { cy.visit('https://example.com') })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .only instead of .skip will run only this test.
Using .focus or .ignore are not valid Cypress test modifiers.
✗ Incorrect
Using
.skip after it tells Cypress to skip this test during execution.2fill in blank
mediumComplete the code to run only this test in Cypress.
Cypress
it[1]('should run only this test', () => { cy.visit('https://example.com') })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .skip will skip this test instead of running only it.
Using .focus or .ignore are not valid Cypress test modifiers.
✗ Incorrect
Using
.only after it tells Cypress to run only this test and skip others.3fill in blank
hardFix the error in this code to skip the whole test suite.
Cypress
describe[1]('My test suite', () => { it('test 1', () => { cy.visit('https://example.com') }) })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .only will run only this suite and skip others.
Using .focus or .ignore are not valid Cypress suite modifiers.
✗ Incorrect
Adding
.skip after describe skips the entire test suite.4fill in blank
hardFill both blanks to run only this test suite and skip others.
Cypress
describe[1]('Focused suite', () => { it[2]('test inside focused suite', () => { cy.visit('https://example.com') }) })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .skip on describe will skip the whole suite, not focus it.
Using .only on it will run only that test, not the suite.
✗ Incorrect
Using
.only after describe runs only this suite, and .skip after it skips the test inside it.5fill in blank
hardFill both blanks to skip one test, focus another, and leave the rest normal.
Cypress
describe('Mixed tests', () => { it[1]('test to skip', () => { cy.visit('https://skip.com') }) it[2]('test to focus', () => { cy.visit('https://focus.com') }) it('normal test', () => { cy.visit('https://normal.com') }) })
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .focus is not a valid Cypress modifier.
Adding .only to multiple tests runs only those tests, ignoring others.
✗ Incorrect
Use
.skip to skip the first test, .only to focus the second test, and no modifier (empty string) for the normal test.