Cypress: run only one test

前端 未结 6 1225
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 07:04

I want to toggle only running one test, so I don\'t have to wait for my other tests to see the result of one test.

Currently, I comment out my other tests, but this is r

6条回答
  •  悲&欢浪女
    2021-01-31 07:16

    You can mute not needed test suites and particular cases by prepending x to testrunner methods call (describe, it, etc.)

    So it would look like:

    // this whole testsuite will be muted
    xdescribe('Visit google', () => { 
      it('should visit google', () => { cy.visit('https://google.com/'); });
    });
    
    // this testsuite will run
    describe('Visit youtube', () => {
      it('should visit youtube', () => { cy.visit('https://youtube.com/'); });
    
      // this testcase will be muted
      xit('is not necessary', () => { ... });
    });
    

提交回复
热议问题