樱桃挑选测试并制作西装

Cherry pick the tests and create suits

有没有办法在 protractor/jasmine e2e 测试中挑选测试并创建套装。我知道量角器在套件中接受通配符规范 (*.spec"),但我正在寻找 select 规范文件中的一些测试,并在量角器上创建一个适合 运行 的套装。任何帮助都是非常感谢。

suites 只能对测试文件进行分组。 不过,我仍然会考虑在测试中重新分组规范,或者将它们拆分为多个文件,以便 suites 可以在此处使用 - 这是组织测试并按逻辑对它们进行分组的好方法。


如果您想 运行 来自不同文件的特定 it() blocks/specs 作为一个组的一部分 - 标记它们:

describe("test1", function () {
    it("should test something (#mytag)", function () {

    });
});

describe("test2", function () {
    it("should test something else (#mytag)", function () {

    });
});

和运行与--grep:

protractor conf.js --grep "#mytag"

另请参阅:


或者,使用 focused specsfdescribe/fit,或 ddescribe/iit):

describe("test1", function () {
    fit("should test something", function () {

    });
});

describe("test2", function () {
    fit("should test something else", function () {

    });
});