Execution Trace Quiz - 3 Questions
Test your understanding
Which test runs when using .only in Cypress?
.skip method do in Cypress testing?.skip.skip method is used to tell Cypress to ignore a test or group during execution..only, which runs only the marked tests, .skip prevents the marked tests from running..skip = skip test [OK]it.only syntax runs only the marked test and skips all others.it.skip skips a test, describe.only runs only a group, and describe.skip skips a group.it.only runs only one test [OK]describe('Group A', () => {
it('Test 1', () => { /* code */ })
it.only('Test 2', () => { /* code */ })
it('Test 3', () => { /* code */ })
})
describe.only('Group B', () => {
it('Test 4', () => { /* code */ })
it('Test 5', () => { /* code */ })
})describe.only effectdescribe.only('Group B') means only Group B runs; Group A is skipped.it.only inside Group Ait.only('Test 2') is inside Group A, Group A is skipped entirely because of describe.only on Group B.describe.only overrides it.only [OK]describe.skip('Group X', () => {
it.only('Test A', () => { /* code */ })
it('Test B', () => { /* code */ })
})
describe('Group Y', () => {
it('Test C', () => { /* code */ })
})
What is the problem with this code?describe.skip effect on Group Xit.only.describe.skip skips whole group, ignoring it.only [OK]describe('My Tests', () => {
it('Test 1', () => { /* code */ })
it('Test 2', () => { /* code */ })
it('Test 3', () => { /* code */ })
})
Options:
A) Add .only to Test 2 and .skip to Test 3.
B) Add .skip to Test 1 and .only to Test 3.
C) Add .only to Test 1 and .skip to Test 2.
D) Add .skip to Test 2 and .skip to Test 3..only on a test runs only that test, skipping all others unless they also have .only. Using .skip skips that test..only to Test 2 and .skip to Test 3. Test 1 will be skipped automatically because of .only..only runs test, .skip skips test [OK]Pass the test and this pattern moves unknown