-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support feature files in a sub directory #788
Comments
I'm not able to reproduce your issue. Can you provide me an example that fails? |
Same issue, i think it is a Windows issue when using glob and common-ancestor-path. commonAncestorPath use delimiter from path which is based on OS which in windows is \ this causes parse to throw null exception |
@badeball I tried to reproduce the issue at home and I could not :/ I forked and pushed updated example that I will test on work PC tomorrow. Few things that I should have mentioned:
|
Hello everyone, EDIT: here an example repository to reproduce https://github.com/kchiron/cypress-preprocessor-tests I reproduce the issue within my project. I have also needed to switch from webpack to esbuild as @FDIM did to get more information about the error :). This is what I got :
followed by :
Our testing projet is organized as follow :
Our tests are written in gherkin language, we use cucumber framework to bind features with sdk folder, or mobile folder or web folder (depends on where we want to run our tests). This folder organization worked fine under Here is the content of the export default defineConfig({
e2e: {
setupNodeEvents,
baseUrl: 'http://localhost:3000',
chromeWebSecurity: false,
scrollBehavior: 'center',
videosFolder: 'cypress/reports',
screenshotsFolder: 'cypress/reports',
specPattern: '../features/',
supportFile: false,
},
})
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config)
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
return config
} I also kept this block in my "cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false,
"step_definitions": "cypress/integration",
"commonPath": "cypress/integration",
"cucumberJson": {
"generate": true,
"outputFolder": "cypress/reports",
"fileSuffix": ""
}
} I tried to move all the content of the I run my tests within the folder
which calls a npm script defined in "tags": "cypress run -e TAGS=$npm_config_tags --browser chrome", This is the list of all dependance I used, if it might help: note: I kept "devDependencies": {
"@cucumber/cucumber": "^7.1.0",
"@cypress/webpack-preprocessor": "5.11.1",
"@faker-js/faker": "6.3.1",
"@testing-library/cypress": "^8.0.3",
"@types/cypress-cucumber-preprocessor": "4.0.1",
"@types/fs-extra": "9.0.13",
"@types/node": "14.18.5",
"@types/tough-cookie": "4.0.2",
"@typescript-eslint/eslint-plugin": "5.22.0",
"@typescript-eslint/parser": "5.22.0",
"axios": "0.27.2",
"cross-env": "7.0.3",
"cypress": "10.4.0",
"date-fns": "2.28.0",
"eslint": "8.15.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-prettier": "4.0.0",
"fs-extra": "10.1.0",
"google-libphonenumber": "3.2.27",
"got": "11.8.5",
"lint-staged": "10.5.4",
"node-polyfill-webpack-plugin": "1.1.4",
"npm-run-all": "4.1.5",
"path": "0.12.7",
"prettier": "2.6.2",
"tough-cookie": "4.0.0",
"ts-loader": "9.3.0",
"typescript": "4.6.4",
"webpack": "5.72.0"
},
"dependencies": {
"@badeball/cypress-cucumber-preprocessor": "12.0.0",
"@bahmutov/cypress-esbuild-preprocessor": "latest",
"moment": "2.29.4",
"moment-with-locales-es6": "1.0.1",
"tsconfig-paths-webpack-plugin": "3.5.2"
} Have a nice day :) |
@badeball I finally managed to reproduce the issue. For some reason if I have multiple files in a sub-folder, I'll get an error: If I remove "sub copy.feature" file, then it works again. The only code change I've done to webpack-ts example is to make it run with cypress 8.5, it's probably the same with v10. |
This has been fixed in v12.0.1. |
Current behavior
In our project we have sub folders with feature files in integration folder. This used to work with previous package, but gives an error with this one.
This has been very fun to debug :)
In this process I actually ended up moving from webpack to esbuild files as I could not make it work with webpack v5. Now I can share a useful stack trace:
`[ERROR] [plugin feature] The "path" argument must be of type string. Received null
This error came from the "onLoad" callback registered here:
Desired behavior
Build should work as normal and not issue a cryptic error message. Webpack version literally threw
The "path" argument must be of type string. Received null
with stack trace originating in internal node package!My current workaround is to patch
template.js
file, specifically the place that assigns value toimplicitIntegrationFolder
.Test code to reproduce
Simply create a sub folder in integration folder and add a feature file there to reproduce this issue.
Versions
Checklist
cypress-cucumber-preprocessor@4.3.1
(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: