You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a SharePoint app for which Cypress is used for testing. Due to SharePoint and Cypress' nature, debugging tests with Open Mode is limited and Cypress by default gives unfortunately next to zero insight why a test failed outside of that.
Which is how I ended up here, and I'm glad that I finally get some insight as to what happened before a failure.
However, there's a small issue with the Player where it expects everypayload to have a .message property.
But "name": "route" payloads never have that property. I have at least never found any in a dump that had a "message" property.
If one of these is clicked the Player throws an exception and breaks itself, requiring a reload of the page to use it again.
I also verified that manually adding said property prevents the exception and with that the entire issue.
I've included a basic Cypress Test script that causes a dump which allows manual causing of the issue.
It should create a dump that when loaded has a [pending] route as 4th step.
Before clicking that step, the browser should be set to break on caught exceptions.
Otherwise the exception will be thrown after the end of the error handler that just handed it down until no one handled it anymore.
After setting that, clicking on [pending] route will stop right at the point where it fails to handle the missing .message property. Edit: I've found out that this only happens when the "Step Details" tab is active, which makes sense because it's the one trying to read the missing property. Clicking the item while the "Console" tab is active for example works fine.
Expected behavior
Not crashing the entire Player from a missing "message" property.
Command and Setup
Cypress test script:
"player_issue.cy.ts"
try {
// preventing "only one instance of polyfill"
require('cypress-debugger').debuggerSupport();
}
catch {}
describe('Player crash demo', () => {
beforeEach(() => {
cy.intercept("GET", "google.com")
.as("intercepted");
});
it('visiting with route', () => {
cy.visit("https://www.google.com")
.should("not.exist"); // only to fail the test to ensure that a dump is created
});
});
Command (share the exact cypress or cypress-cloud command you're running)
Batchfile because PowerShell is annoying about ENV variables => "debug_runner.bat":
set ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port=9222
cmd /c npx cypress run -s %*
Actual command entered in PowerShell: .\debug_runner.bat .\player_issue.cy.ts
# Put output below this line
Nothing special, just the normal output that results from running a test.
Setup files cypress.config.ts
# Put output below this line
import { defineConfig } from "cypress";
import { debuggerPlugin } from "cypress-debugger";
export default defineConfig({
viewportWidth: 1280,
viewportHeight: 800,
trashAssetsBeforeRuns: false,
e2e: {
experimentalMemoryManagement: true,
chromeWebSecurity: false,
modifyObstructiveCode: true,
experimentalModifyObstructiveThirdPartyCode: true,
setupNodeEvents(on, config) {
debuggerPlugin(on, config, {
failedTestsOnly: true,
},
},
});
Full log and debug output
I have no debug log because this issue is with the Player, not the module running during testing.
The text was updated successfully, but these errors were encountered:
BloodyRain2k
changed the title
payload without "message" property crashes the Player if clicked
payload without "message" property crashes the Player when trying to show Step Details
Dec 7, 2023
BloodyRain2k
changed the title
payload without "message" property crashes the Player when trying to show Step Details
[Player] payload without "message" property crashes the Player when trying to show Step Details
Dec 8, 2023
Before opening, please confirm:
Environment information
Describe the bug
I'm working on a SharePoint app for which Cypress is used for testing. Due to SharePoint and Cypress' nature, debugging tests with Open Mode is limited and Cypress by default gives unfortunately next to zero insight why a test failed outside of that.
Which is how I ended up here, and I'm glad that I finally get some insight as to what happened before a failure.
However, there's a small issue with the Player where it expects every
payload
to have a.message
property.But "name": "route" payloads never have that property. I have at least never found any in a dump that had a "message" property.
If one of these is clicked the Player throws an exception and breaks itself, requiring a reload of the page to use it again.
I also verified that manually adding said property prevents the exception and with that the entire issue.
I've included a basic Cypress Test script that causes a dump which allows manual causing of the issue.
It should create a dump that when loaded has a
[pending] route
as 4th step.Before clicking that step, the browser should be set to break on caught exceptions.
Otherwise the exception will be thrown after the end of the error handler that just handed it down until no one handled it anymore.
After setting that, clicking on
[pending] route
will stop right at the point where it fails to handle the missing.message
property.Edit: I've found out that this only happens when the "Step Details" tab is active, which makes sense because it's the one trying to read the missing property. Clicking the item while the "Console" tab is active for example works fine.
Expected behavior
Not crashing the entire Player from a missing "message" property.
Command and Setup
Cypress test script:
"player_issue.cy.ts"
Command (share the exact
cypress
orcypress-cloud
command you're running)Batchfile because PowerShell is annoying about ENV variables => "debug_runner.bat":
Actual command entered in PowerShell:
.\debug_runner.bat .\player_issue.cy.ts
Setup files cypress.config.ts
Full log and debug output
I have no debug log because this issue is with the Player, not the module running during testing.
The text was updated successfully, but these errors were encountered: