Is it possible to run tests in "open" mode via a script? #28921
Unanswered
BloodyRain2k
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR: I've been using Cypress for a couple months now, trying to make it work for testing a SharePoint App I'm working on.
And I'm at the point where I need one of the following two:
I also want to mention that I am aware (now) and understand why it's a bad idea to test against an external system.
But if I were to switch to any of the alternative test tools, I'd have to rebuild a portion of what Cypress already has anyways.
Long version:
Testing a SharePoint App with Cypress comes with a couple of challenges that make testing difficult, but debugging test failures even more difficult.
Most of the time it's just something on SharePoint's side that throws a 503 or almost times out. Something that would be recoverable in testing, if I could react to it.
Starting with the fact that Cypress gives me almost nothing to work with when something fails. I get the test's code that failed, but good luck trying to find out why it resulted in a state where it failed.
There's the video recordings of course, but those don't show the console and the bloat that SharePoint demands to load just destroys the command log. So the videos are nice as an idea, but in 95% of the cases useless because nothing helpful was ever visible.
Then I tried out the Cypress-Debugger, which is basically an "offline version" of "Test Replay". Took a while to get that working, and while it does note a lot more info than videos, it has it's own issues that make it almost as useless once something actually failed.
After that I've eventually tried out the actual "Test Replay" feature, which works fine as long as nothing fails.
The main problem I have with it is that it sometimes creates failures that never existed before at all. And these are gone the moment I don't use it anymore. So it's also not helpful.
Leaving aside that I'm not a fan of uploading everything to the cloud just because there's no "local" option.
Which brings me to the reason for my question.
With all I've learned about Cypress and SharePoint so far, it's clear that the only way to debug the tests is by running them in "open" mode. Because that's the only time Cypress doesn't immediately throw away everything I need to understand what even failed.
But most of the time nothing goes wrong at all, so manually going through the tests in "open" mode until the browser crashes due to snapshot overflow is a mindless task. Meaning that I'd be very prone to miss which test to do next and negate any advantage of "automated" testing.
If I run it in
headed
"run" mode instead, I'm very limited in what I can do with the data. Because the only way I've found so far to "pause" the runner isdebugger;
, which halts the entire browser. This unfortunately also freezes all access to the previous step's details.Any "ending" of the run just causes the runner to kill the browser right after, which is what it's meant to do for normal operation, but I'd need a way to prevent it from that...
So is it instead somehow possible to run it in "open" mode while still telling "run this test and then exit IF nothing failed"?
Beta Was this translation helpful? Give feedback.
All reactions