-
Notifications
You must be signed in to change notification settings - Fork 403
/
mixing_types.feature
43 lines (42 loc) · 1.23 KB
/
mixing_types.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Feature: mixing feature and non-feature specs
Background:
Given if pre-v10, additional Cypress configuration
"""
{
"testFiles": "**/*.{spec.js,feature}"
}
"""
And if post-v10, additional Cypress configuration
"""
{
"e2e": {
"specPattern": "**/*.{spec.js,feature}"
}
}
"""
Scenario: one feature and non-feature specs
Given a file named "cypress/e2e/a.feature" with:
"""
@foo
Feature: a feature name
Scenario: a scenario name
Given a step
"""
And a file named "cypress/support/step_definitions/steps.js" with:
"""
const { When, isFeature, doesFeatureMatch } = require("@klaveness/cypress-cucumber-preprocessor");
When("a step", function() {
expect(isFeature()).to.be.true;
expect(doesFeatureMatch("@foo")).to.be.true;
});
"""
And a file named "cypress/e2e/b.spec.js" with:
"""
const { isFeature } = require("@klaveness/cypress-cucumber-preprocessor");
it("should work", () => {
expect(isFeature()).to.be.false;
});
"""
When I run cypress
Then it passes
And it should appear to have ran spec "a.feature" and "b.spec.js"