-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Question: npx bddgen is not getting exited properly. #197
Comments
Hi @dpjp !
|
Hi @vitalets , I tried the above commands. The npx bddgen works fine in the playwright-bdd-example project. And also, observed that the issue was causing because of aspose.cells nodejs via java npm package. Am using this package in my project for excel manipulations. Aspose.cells npm package If I have aspose.cells installed in my project, the npx bddgen is not exiting properly. But after uninstalling the aspose.cells, I see that the npx bddgen seems to be working fine. |
I've tried to install
But I see in readme they highly recommend to migrate to Aspose.Cells for Node.js via C++. I've checked - it installs correctly and |
Hi @vitalets @VitaliyPotapov - For the past few days, I had been following up on this with aspose.cells support and my project engineering team. Due to security concerns and performance issues, I will not be able to use aspose.cells for Node.js via c++ as they set license using a file and cannot have the license file in shared repository, whereas, for nodejs via java we use metered license and we can store the keys in secrets. Also, aspose support team confirmed that they will be supporting this aspose.cells for nodejs via Java in the future and dont have any plans to retire/deprecate it. So I think we have only this option(use aspose.cells for nodejs via Java) to go with. Aspose support ticket reference: https://forum.aspose.com/t/aspose-cells-node-version-24-7-npm-library/288564 Issue Description: I was able to do npm install for aspose.cells and Java. After the above installation steps, npx bddgen works fine. In order to use the aspose.cells for nodejs via java in my office laptop, I am forced to set the certificate in Java bin folder using keytool command as mentioned below "keytool -import -trustcacerts -file /ca-certificatename -alias custom-Root-CA -keystore ..\jre\lib\security\cacerts" Only after setting the certificate, am facing this issue.(npx bddgen is not exiting properly). Note: Only after installing the certificate, the system will allow to set aspose.cells license and my code works fine. Can you help me if you have any workaround / solution towards this ? |
Hey @dpjp Lets try the following:
|
Hi @vitalets, @VitaliyPotapov - Sorry.. Ignore my last post. I see the issue is in the below lines. In one of my .ts class, var aspose:any = aspose || {}; The same code works with playwright test runner(excluded playwright-bdd). Do you have any work around for this ? |
If you just run the following file with // file.js
var aspose = aspose || {};
aspose.cells= require("aspose.cells"); Run:
|
@vitalets - When executed the above code, I see that its not exiting. But when executing the same code with playwright test runner, am not seeing any issue. |
Ok. Then please try this command, to get the exact reason of hanging:
Also, haven't you open an issue in aspose forum? Because hanging of In Playwright it exists, because Playwright internally calls |
Hi @vitalets - I tried running this command 'npx why-is-node-running file.js' and I see the below error. Also, Yes, I did posted in the aspose.cells forum and I got the below response and still no luck. Is there any work around using this command ? |
Then we can try to wrap the call of const { spawn } = require('node:child_process');
const child = spawn('./node_modules/.bin/bddgen', ['--verbose']); // for windows there can be bddgen.bat
child.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
if (data.includes('Generating Playwright tests')) {
setTimeout(() => child.kill(), 2000);
}
}); And run it:
Let me know, does it work? Note: |
Hi @vitalets - Am I doing anything wrong here? Tried executing the same. I get the below error and says that its unable to locate the executable. Also, in the bin folder under node modules, I see the below files. |
Hi @dpjp |
Hi @vitalets - Yes. I did try the same previously for .cmd and .ps1. I was getting the below error. Also, wanted to check on the below. I had generated the steps definitions for the steps(in screenshot). But still it says undefined steps and when pressed "F12" from the feature file, Its not navigating to the corresponding step definition. I tried setting the cucumber. Glue in settings.json file as well. |
I'm not on windows, so tried to ask chatgpt to check, that's the suggested code: const { spawn } = require('child_process');
const path = require('path');
// Assuming `bddgen` is installed as a dependency in your project
const bddgenPath = path.resolve(__dirname, 'node_modules', '.bin', 'bddgen');
const child = spawn(bddgenPath, ['--verbose'], {
stdio: 'inherit', // This option will output the child process logs in the parent process
shell: true // Helps with path resolution on Windows
});
child.on('error', (err) => {
console.error('Failed to start subprocess:', err);
});
child.on('close', (code) => {
console.log(`Child process exited with code ${code}`);
}); Please try with it.
Lets track it in a separate issue. Please share project structure or try to reproduce it based on https://github.com/vitalets/playwright-bdd-example |
Hi @vitalets - Good Day. Am trying to execute the npx bddgen with the below version. I see that the features-gen folder is successfully created with test *.spec.js files, but the process is not getting exited properly. Not sure what causes this problem. In local am able to do "Ctrl + C" and continue with my execution. But in pipeline, this particular step
npx bddgen
is taking longer time and its not getting exited. Also, tried debugging with nodemon mentioned in the documentation, still no luck. Can you help me here how can I fix this issue ?Attached is the screenshot for your reference.
Please let me know if you need any other information.
Note: tried clearing npm cache, uninstall and reinstall playwright-bdd,
The text was updated successfully, but these errors were encountered: