Hasan
Hasan

Reputation: 188

dynamically skip protractor tests

Is there a way to skip protractor test dynamically? I have scenarios where a user can select any specific test to perform. So, I want to execute only the tests user has specified and dependent tests, all other tests should be skipped.

I am using grunt-protractor-runner.

Upvotes: 3

Views: 2309

Answers (2)

eva.eis
eva.eis

Reputation: 36

May be for you not actual. But it may be useful for other people. You can try to use the next construction:

it('your test', function(done)){

if('user action or result of user action'){
console.log("Test is skiped");
done();
}
//other test's code
...................
done(); 
}

Upvotes: 0

Gabriel Kohen
Gabriel Kohen

Reputation: 4296

As shown in this question, you can specify a URL of a specific spec. Otherwise you'd have to use the focused fdescribe/fit but you can't change it in runtime. This is not related to Protractor but rather specific to Jasmine.

Upvotes: 1

Related Questions