protractor Getting started with protractor Selective Running Tests

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Protractor can selectively run groups of tests using fdescribe() instead of describe().

fdescribe('first group',()=>{
    it('only this test will run',()=>{
        //code that will run
    });
});
describe('second group',()=>{
    it('this code will not run',()=>{
        //code that won't run
    });
});

Protractor can selectively run tests within groups using fit() instead of it().

describe('first group',()=>{
    fit('only this test will run',()=>{
        //code that will run
    });
    it('this code will not run',()=>{
        //code that won't run
    });
});

If there is no fit() within an fdescribe(), then every it() will run. However, a fit() will block it() calls within the same describe() or fdescribe().

fdescribe('first group',()=>{
    fit('only this test will run',()=>{
        //code that will run
    });
    it('this code will not run',()=>{
        //code that won't run
    });
});

Even if a fit() is in a describe() instead of an fdescribe(), it will run. Also, any it() within an fdescribe() that does not contain a fit() will run.

fdescribe('first group',()=>{
    it('this test will run',()=>{
        //code that will run
    });
    it('this test will also run',()=>{
        //code that will also run
    });
});
describe('second group',()=>{
    it('this code will not run',()=>{
        //code that won't run
    });
    fit('this code will run',(){
        //code that will run
    });
});


Got any protractor Question?