You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I configure custom stepDefinitions, the [filepath] expression is resolving only to the cypress/e2e CAP folder and ignoring any subfolders that the feature file appears in
For example, I have a feature file located at cypress\e2e\smoke\duckduckgo.feature, and a steps file located at cypress\e2e\smoke\duckduckgo.ts
Using the following settings in my package.json (this is the "default" specified in step-definitions.md):
I receive a step resolution error, which seems to be indicating it is resolving [filepath] to cypress\e2e\duckduckgo.{js,ts}, not including the smoke subfolder. Below is the full debug log:
DevTools listening on ws://127.0.0.1:64476/devtools/browser/fc311076-d939-4375-9a84-bf149475a13c
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 13.11.0
│
│ Browser: Electron 118 (headless)
│
│ Node Version: v18.18.2 (C:\Program Files\nodejs\node.exe)
│
│ Specs: 1 found (duckduckgo.feature)
│
│ Searched: **/*.feature
│
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: duckduckgo.feature (1 of 1)
duckduckgo.com
1) visiting the frontpage
0 passing (252ms)
1 failing
1) duckduckgo.com
visiting the frontpage:
Error:
Step implementation missing for "I visit duckduckgo.com".
We tried searching for files containing step definitions using the following search pattern templates:
- cypress/e2e/[filepath]/**/*.{js,ts}
- cypress/e2e/[filepath].{js,ts}
- cypress/support/step_definitions/**/*.{js,ts}
These templates resolved to the following search patterns:
- cypress\e2e\duckduckgo\**\*.{js,ts}
- cypress\e2e\duckduckgo.{js,ts}
- cypress\support\step_definitions\**\*.{js,ts}
These patterns matched **no files** containing step definitions. This almost certainly means that you have misconfigured `stepDefinitions`.
You can implement it using the suggestion(s) below.
When("I visit duckduckgo.com", function () {
return "pending";
});
at Context.eval (https://duckduckgo.com/__cypress/tests?p=cypress\e2e\smoke\duckduckgo.feature:14699:29)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1
│
│ Passing: 0
│
│ Failing: 1
│
│ Pending: 0
│
│ Skipped: 0
│
│ Screenshots: 1
│
│ Video: false
│
│ Duration: 0 seconds
│
│ Spec Ran: duckduckgo.feature
│
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Screenshots)
- C:\Projects\TestAutomation\cypress\screenshots\duckduckgo.feature\duckduckgo.com (1280x720)
-- visiting the frontpage (failed).png
====================================================================================================
(Run Finished)
───┐
│ × duckduckgo.feature 254ms 1 - 1 - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
× 1 of 1 failed (100%) 254ms 1 - 1 - -
This issue does NOT occur if I do not specify custom step definition patterns and leave it at the default (again, even though I started with just configuring the "default" step definition patterns in my package.json). It also does NOT occur if I place the files directly in the e2e folder and not in a subfolder
Desired behavior
[filepath] SHOULD resolve to cypress\e2e\smoke\duckduckgo.{js,ts} for this feature file, including its subfolder
Change cypress/e2e to cypress/e2e/smoke in package.json.
[filepath] SHOULD resolve to cypress\e2e\smoke\duckduckgo.{js,ts} for this feature file, including its subfolder
No. You should read the documentation regarding pairing carefully, especially the part about common ancestor path. If you start adding more features outside of the smoke directory, then your original configuration will start working.
Thanks. I read that documentation multiple times but that part went over my head. As a temporary solution until more tests are added I just added a dummy feature file in a separate folder.
Current behavior
If I configure custom stepDefinitions, the [filepath] expression is resolving only to the cypress/e2e CAP folder and ignoring any subfolders that the feature file appears in
For example, I have a feature file located at cypress\e2e\smoke\duckduckgo.feature, and a steps file located at cypress\e2e\smoke\duckduckgo.ts
Using the following settings in my package.json (this is the "default" specified in step-definitions.md):
I receive a step resolution error, which seems to be indicating it is resolving [filepath] to cypress\e2e\duckduckgo.{js,ts}, not including the smoke subfolder. Below is the full debug log:
This issue does NOT occur if I do not specify custom step definition patterns and leave it at the default (again, even though I started with just configuring the "default" step definition patterns in my package.json). It also does NOT occur if I place the files directly in the e2e folder and not in a subfolder
Desired behavior
[filepath] SHOULD resolve to cypress\e2e\smoke\duckduckgo.{js,ts} for this feature file, including its subfolder
Test code to reproduce
https://github.com/Aryndel/cypress-cucumber-test/tree/main
This is nearly identical to the esbuild-ts example, just with custom stepDefinitions and with the duckduckgo files in a subfolder
Versions
Checklist
[email protected]
(package name has changed and it is no longer the most recent version, see #689).The text was updated successfully, but these errors were encountered: