-
Notifications
You must be signed in to change notification settings - Fork 268
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
chore: env. CLOSE_DEVTOOLS can enforce devtools closed during test #4988
Conversation
packages/main/src/mainWindow.ts
Outdated
@@ -95,7 +95,9 @@ async function createWindow(): Promise<BrowserWindow> { | |||
} | |||
|
|||
if (import.meta.env.DEV) { | |||
browserWindow?.webContents.openDevTools(); | |||
if (!process.env.CLOSE_DEVTOOLS || process.env.CLOSE_DEVTOOLS !== 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not sound logic: I would rather have OPEN_DEVTOOLS=false to prevent opening DevTools. And test should be merged with previous test
here I would opt-in for a Podman Desktop preference where in development mode, I can choose between : no dev tools, or all the options of devtools like the mode: openDevTools has the parameter option:
|
@benoitf Can you please clarify more about how this can be put into preferences and how it should work? Right now I am just assuming and doing something that will not show up on preferences since when in development mode, it is too late for e2e tests, and for I can only see a benefit in using configuration properties as a way how to configure dev tools in dev mode on application start up but I am not sure how pick up two different options other than using env. vars. (Yes, @jeffmaury is right about wrong names). |
Signed-off-by: Ondrej Dockal <odockal@redhat.com>
Signed-off-by: Ondrej Dockal <odockal@redhat.com>
6def88e
to
0c8a9f4
Compare
for example today, if I'm not interested to see devtools, I need to close the window each time I run it. so while it can fit with developer experience, I would rather add the setting as a setting rather than using an environment variable. |
superseded by #5280 |
What does this PR do?
Introduces an option how to enforce podman desktop not to open dev tools window. Especially during testing.
This bring only a condition in
packages/main/src/mainWindow.ts
that checks for env. var. CLOSE_DEVTOOLS, if it is defined and is'true'
, thenbrowserWindow?.webContents.openDevTools();
is not called during application start up. This applies only in DEV mode which can be used mainly duringyarn watch
and during running the e2e tests. next pr will bring default setup of this env. var intests/src/runner/podman-desktop-runner.ts
during application start up. Resulting in a testing window without half of the space covered with dev tools.Screenshot/screencast of this PR
What issues does this PR fix or reference?
#4983 #4968
How to test this PR?
you can run tests without any change.
yarn test:e2e:smoke
. Check for the app during test run and verify that there is a dev tools opened. Then addcross-env CLOSE_DEVTOOLS=true
at a beginning of a npm tasktest:e2e:smoke:ruin
inpackage.json
, task: `. If you then execute the tests, you should obeserve that dev tools were closed during testing.