|
1 | 1 | Feature: undefined Steps
|
2 | 2 |
|
3 |
| - Scenario: no files containing step definitions |
4 |
| - Given a file named "cypress/e2e/a.feature" with: |
5 |
| - """ |
6 |
| - Feature: a feature name |
7 |
| - Scenario: a scenario name |
8 |
| - Given an undefined step |
9 |
| - """ |
10 |
| - When I run cypress |
11 |
| - Then it fails |
12 |
| - And the output should contain |
13 |
| - """ |
14 |
| - Step implementation missing for "an undefined step". |
15 |
| -
|
16 |
| - We tried searching for files containing step definitions using the following search pattern templates: |
17 |
| -
|
18 |
| - - cypress/e2e/[filepath]/**/*.{js,mjs,ts,tsx} |
19 |
| - - cypress/e2e/[filepath].{js,mjs,ts,tsx} |
20 |
| - - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
21 |
| -
|
22 |
| - These templates resolved to the following search patterns: |
23 |
| -
|
24 |
| - - cypress/e2e/a/**/*.{js,mjs,ts,tsx} |
25 |
| - - cypress/e2e/a.{js,mjs,ts,tsx} |
26 |
| - - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
27 |
| -
|
28 |
| - These patterns matched **no files** containing step definitions. This almost certainly means that you have misconfigured `stepDefinitions`. |
29 |
| - """ |
30 |
| - |
31 |
| - Scenario: step definitions exist, but none matching |
32 |
| - Given a file named "cypress/e2e/a.feature" with: |
33 |
| - """ |
34 |
| - Feature: a feature name |
35 |
| - Scenario: a scenario name |
36 |
| - Given an undefined step |
37 |
| - """ |
38 |
| - And a file named "cypress/support/step_definitions/steps.js" with: |
39 |
| - """ |
40 |
| - const { When } = require("@badeball/cypress-cucumber-preprocessor"); |
41 |
| - When("unused step definition", function() {}); |
42 |
| - """ |
43 |
| - When I run cypress |
44 |
| - Then it fails |
45 |
| - And the output should contain |
46 |
| - """ |
47 |
| - Step implementation missing for "an undefined step". |
48 |
| -
|
49 |
| - We tried searching for files containing step definitions using the following search pattern templates: |
50 |
| -
|
51 |
| - - cypress/e2e/[filepath]/**/*.{js,mjs,ts,tsx} |
52 |
| - - cypress/e2e/[filepath].{js,mjs,ts,tsx} |
53 |
| - - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
54 |
| -
|
55 |
| - These templates resolved to the following search patterns: |
56 |
| -
|
57 |
| - - cypress/e2e/a/**/*.{js,mjs,ts,tsx} |
58 |
| - - cypress/e2e/a.{js,mjs,ts,tsx} |
59 |
| - - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
60 |
| -
|
61 |
| - These patterns matched the following files: |
62 |
| -
|
63 |
| - - cypress/support/step_definitions/steps.js |
64 |
| -
|
65 |
| - However, none of these files contained a step definition matching "an undefined step". |
66 |
| - """ |
| 3 | + Rule: it should output appropriate path info |
| 4 | + |
| 5 | + Scenario: no files containing step definitions |
| 6 | + Given a file named "cypress/e2e/a.feature" with: |
| 7 | + """ |
| 8 | + Feature: a feature name |
| 9 | + Scenario: a scenario name |
| 10 | + Given an undefined step |
| 11 | + """ |
| 12 | + When I run cypress |
| 13 | + Then it fails |
| 14 | + And the output should contain |
| 15 | + """ |
| 16 | + Step implementation missing for "an undefined step". |
| 17 | +
|
| 18 | + We tried searching for files containing step definitions using the following search pattern templates: |
| 19 | +
|
| 20 | + - cypress/e2e/[filepath]/**/*.{js,mjs,ts,tsx} |
| 21 | + - cypress/e2e/[filepath].{js,mjs,ts,tsx} |
| 22 | + - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
| 23 | +
|
| 24 | + These templates resolved to the following search patterns: |
| 25 | +
|
| 26 | + - cypress/e2e/a/**/*.{js,mjs,ts,tsx} |
| 27 | + - cypress/e2e/a.{js,mjs,ts,tsx} |
| 28 | + - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
| 29 | +
|
| 30 | + These patterns matched **no files** containing step definitions. This almost certainly means that you have misconfigured `stepDefinitions`. |
| 31 | + """ |
| 32 | + |
| 33 | + Scenario: step definitions exist, but none matching |
| 34 | + Given a file named "cypress/e2e/a.feature" with: |
| 35 | + """ |
| 36 | + Feature: a feature name |
| 37 | + Scenario: a scenario name |
| 38 | + Given an undefined step |
| 39 | + """ |
| 40 | + And a file named "cypress/support/step_definitions/steps.js" with: |
| 41 | + """ |
| 42 | + const { When } = require("@badeball/cypress-cucumber-preprocessor"); |
| 43 | + When("unused step definition", function() {}); |
| 44 | + """ |
| 45 | + When I run cypress |
| 46 | + Then it fails |
| 47 | + And the output should contain |
| 48 | + """ |
| 49 | + Step implementation missing for "an undefined step". |
| 50 | +
|
| 51 | + We tried searching for files containing step definitions using the following search pattern templates: |
| 52 | +
|
| 53 | + - cypress/e2e/[filepath]/**/*.{js,mjs,ts,tsx} |
| 54 | + - cypress/e2e/[filepath].{js,mjs,ts,tsx} |
| 55 | + - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
| 56 | +
|
| 57 | + These templates resolved to the following search patterns: |
| 58 | +
|
| 59 | + - cypress/e2e/a/**/*.{js,mjs,ts,tsx} |
| 60 | + - cypress/e2e/a.{js,mjs,ts,tsx} |
| 61 | + - cypress/support/step_definitions/**/*.{js,mjs,ts,tsx} |
| 62 | +
|
| 63 | + These patterns matched the following files: |
| 64 | +
|
| 65 | + - cypress/support/step_definitions/steps.js |
| 66 | +
|
| 67 | + However, none of these files contained a step definition matching "an undefined step". |
| 68 | + """ |
| 69 | + |
| 70 | + Rule: it should output snippet suggestions |
| 71 | + |
| 72 | + Scenario: undefined step without args |
| 73 | + Given a file named "cypress/e2e/a.feature" with: |
| 74 | + """ |
| 75 | + Feature: a feature name |
| 76 | + Scenario: a scenario name |
| 77 | + Given an undefined step |
| 78 | + """ |
| 79 | + When I run cypress |
| 80 | + Then it fails |
| 81 | + And the output should contain |
| 82 | + """ |
| 83 | + You can implement it using the suggestion(s) below. |
| 84 | +
|
| 85 | + Given("an undefined step", function () { |
| 86 | + return "pending"; |
| 87 | + }); |
| 88 | + """ |
| 89 | + |
| 90 | + Scenario: undefined step with doc string |
| 91 | + Given a file named "cypress/e2e/a.feature" with: |
| 92 | + """ |
| 93 | + Feature: a feature name |
| 94 | + Scenario: a scenario name |
| 95 | + Given an undefined step |
| 96 | + \"\"\" |
| 97 | + foo |
| 98 | + \"\"\" |
| 99 | + """ |
| 100 | + When I run cypress |
| 101 | + Then it fails |
| 102 | + And the output should contain |
| 103 | + """ |
| 104 | + You can implement it using the suggestion(s) below. |
| 105 | +
|
| 106 | + Given("an undefined step", function (docString) { |
| 107 | + return "pending"; |
| 108 | + }); |
| 109 | + """ |
| 110 | + |
| 111 | + Scenario: undefined step with data table |
| 112 | + Given a file named "cypress/e2e/a.feature" with: |
| 113 | + """ |
| 114 | + Feature: a feature name |
| 115 | + Scenario: a scenario name |
| 116 | + Given an undefined step |
| 117 | + | foo | |
| 118 | + | bar | |
| 119 | + """ |
| 120 | + When I run cypress |
| 121 | + Then it fails |
| 122 | + And the output should contain |
| 123 | + """ |
| 124 | + You can implement it using the suggestion(s) below. |
| 125 | +
|
| 126 | + Given("an undefined step", function (dataTable) { |
| 127 | + return "pending"; |
| 128 | + }); |
| 129 | + """ |
0 commit comments