Open badeball opened 2 years ago
@badeball I see you also opened #https://github.com/cypress-io/cypress/issues/20789, are you utlizing this value to determine how your plugin should behave?
Exactly, yes. For my plugin, some configuration options are more sensible in run-mode compared to open-mode, so in absence of an explicit choice from the user I want my plugin to behave least surprising, which for my case mean differing between the two modes.
Maybe I've been unclear here, but
This is set by Cypress when open mode is leveraged and It's not intended to be a configurable property.
this value appears to be true when open mode is not leveraged as well.
And just to be thorough again, I don't intend to set this attribute, merely read it.
I'm having the same issue. I have a plugin that adds some utility stuff like a webserver and such for the user to interact with via the user interface (in my case it's about managing database snapshots and docker containers); I don't want this stuff to run in the run
mode. I wonder why this would be broken and if it's relatively easy to fix?
@badeball, @luxalpa - Just ran into this and discovered that config.isTextTerminal
does seem to be updated for plugins and can be used as a proxy for isInteractive
. I found that cypress sets isInteractive
as the opposite of isTextTerminal
so perhaps that'll work for you.
I can confirm the issue still exists on the version 12.9.0
I've been able to reproduce this also, so I'm routing it to the team. Thanks for the report and follow up!
In the meantime, is config.isTextTerminal
working as a workaround for people, or is this block for any of you?
Blocking or not, it's still clearly wrong though and should be corrected. It seems like plugin code might be needless running in run mode for some people.
Reproducible for v13.2.0.
Currently took "config.isTextTerminal"
as a temporary replacement until "isInteractive" flag is fixed
This just bit me too (Cypress v13.6.2
). My plugin listens to the network and archives the resources to the user's cypress/downloads
folder. I'm using config.isInteractive
(in the before:browser:launch
event) to not do this during cypress open
since the downloads
folder isn't cleared in that case (and for a couple other reasons).
@jennifer-shehane in the meantime, is there a value I can reliably use to know whether the user is doing cypress open
vs cypress run
?
This just bit me too (Cypress v
13.6.2
). My plugin listens to the network and archives the resources to the user'scypress/downloads
folder. I'm usingconfig.isInteractive
(in thebefore:browser:launch
event) to not do this duringcypress open
since thedownloads
folder isn't cleared in that case (and for a couple other reasons).@jennifer-shehane in the meantime, is there a value I can reliably use to know whether the user is doing
cypress open
vscypress run
?
See my reply above for the temporary workaround. Works perfectly since Oct 2023.
Current behavior
The
isInteractive
properly appears to always be true in the eyes of plugins, despite when in run-mode.Desired behavior
No response
Test code to reproduce
Cypress Version
9.5.2
Other
No response