Is there a way to cherry pick the tests and create suits in protractor/jasmine e2e test. I know protractor accepts with wildcard specs (*.spec") in the suites, but I am looking for select few tests in spec files and create a suit to run on protractor. Any help on this is greatly appreciated.
1
votes
1 Answers
3
votes
suites can only group test files. Though, I would still think about regrouping the specs inside tests, or splitting them into multiple files so that suites can be used here - it is a great way to organize your tests and group them logically.
If you want to run specific it() blocks/specs from different files as a part of a group - tag them:
describe("test1", function () {
it("should test something (#mytag)", function () {
});
});
describe("test2", function () {
it("should test something else (#mytag)", function () {
});
});
And run with --grep:
protractor conf.js --grep "#mytag"
See also:
Alternatively, use focused specs (fdescribe/fit, or ddescribe/iit):
describe("test1", function () {
fit("should test something", function () {
});
});
describe("test2", function () {
fit("should test something else", function () {
});
});
it()s instead of test files? - alecxe