Open carvedcow opened 6 months ago
Hello @carvedcow,
It's expected that an argument containing a space is wrapped in quotes because this allows you to pass a single argument as a string.
If you need to obtain a string like --test: 1
, split your argument into two and write it in appArgs
: "appArgs": ["--test:", "1"]
.
In the second case, try enclosing your path in single quotes: "appArgs": ["--location='C:'"]
.
Please let us know your results.
Hi @PavelMor25,
Thank you very much for your reply.
The multiple arguments trick worked for white spaces.
For the quotation marks however, the electron application requires double quotation marks. I've tried ' and ` and both wouldn't work.
Is there no way to have quotation marks (") inside an app argument?
Best regards,
You can try using a JavaScript configuration file instead of JSON:
module.exports = {
mainWindowUrl: './index.html',
appArgs: ['--test:', '1', '--location="C://"'],
}
After using:
module.exports = {
mainWindowUrl: './index.html',
appArgs: ['--test:', '1', '--location="C://"'],
}
The backslash and quotation marks would show up:
Can you share a minimal working example? I will try find a solution for your usage scenario. Currently, I can't determinate where the issue occurs.
Apologies for the late response, here is a minimal working example: https://github.com/carvedcow/test_hello_world
The goal is to be able to run the testScript.js script on the test.exe electron application with the app arguments provided in .testcafe-electron-rc.js.
When I launch the test, the argument I want testcafe to use for the app is:
test.exe --test=".\test folder\test.html"
but I can't get the proper formatting.
Thank you
Hello @carvedcow,
Thank you for sharing the code.
Could you modify the example so that we can reproduce your scenario or that it shows exactly which arguments are passed into the application? Currently, when running testScript.js, the test passes, and we can't determine the issue.
Hi @PavelMor25,
I've updated the code to display the argument being passed from .testcafe-electron-rc.js to testScript.js but the actual argument being used by test.exe is displayed under the Details tab in the Task Manager during test.exe's runtime.
Thank you.
We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.
Hi, I'm trying to use app arguments for my executable electron application but I'm having 2 issues.
Here is the app's arguments in Task Manager:
vs
![image](https://github.com/DevExpress/testcafe-browser-provider-electron/assets/58233754/fb1c5d5a-9076-47cb-9fa8-0ea052c28e9b)
Thank you very much for your time.