-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add isolation resource error test
- Loading branch information
Showing
14 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
cypress/integration/2-isolation-monitoring/isolation-resource-error.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/// <reference types="cypress" /> | ||
import { findMultiAndMatch } from '../common'; | ||
|
||
describe('monitoring the isolation', () => { | ||
beforeEach(() => { | ||
Cypress.env({ | ||
garfishRunConfig: { | ||
basename: '/garfish-app', | ||
}, | ||
}); | ||
cy.on('uncaught:exception', () => { | ||
return false; | ||
}); | ||
cy.visit('http://localhost:2333/garfish-app/react/monitoring'); | ||
cy.intercept('POST', '/monitor_browser/collect/batch/', {}).as('post'); | ||
}); | ||
|
||
const MonitoringTitle = 'React sub App Monitoring'; | ||
|
||
const resourceRequest = (msg) => { | ||
return { | ||
payload: { | ||
url: msg, | ||
}, | ||
}; | ||
}; | ||
|
||
const resourcePatch = { | ||
ev_type: 'resource_error', | ||
}; | ||
|
||
const resourceMessageMap = { | ||
mainJsResource: 'http://localhost:1111/monitoring/xxxxx.js', | ||
subAppJsResource: 'http://localhost:0000/monitoring/xxxxx.js', | ||
}; | ||
|
||
it('subApp resource error isolation', () => { | ||
cy.window().then((win) => { | ||
cy.contains('[data-test=title]', MonitoringTitle); | ||
cy.get('[data-test=click-resource-error]').click(); | ||
|
||
findMultiAndMatch( | ||
1, | ||
resourcePatch, | ||
resourceRequest(resourceMessageMap.subAppJsResource), | ||
{ | ||
'payload.url': resourceMessageMap.subAppJsResource, | ||
}, | ||
); | ||
}); | ||
}); | ||
|
||
it('mainApp resource error isolation', () => { | ||
cy.window().then((win) => { | ||
cy.contains('[data-test=title]', MonitoringTitle); | ||
cy.get('[data-test=main-click-resource-error]').click(); | ||
|
||
findMultiAndMatch( | ||
1, | ||
resourcePatch, | ||
resourceRequest(resourceMessageMap.mainJsResource), | ||
{ | ||
'payload.url': resourceMessageMap.mainJsResource, | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
Binary file removed
BIN
-129 KB
...e process app render -- Switch to the React app use Garfish router (failed).png
Binary file not shown.
Binary file removed
BIN
-112 KB
...itSubApp.spec.js/whole process app render -- Switch to the Vue app (failed).png
Binary file not shown.
Binary file removed
BIN
-112 KB
...js/whole process app render -- Switch to the Vue2 app use js entry (failed).png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+119 KB
cypress/videos/2-isolation-monitoring/isolation-http-request.spec.js.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters