test: percy snapshot workaround (#1111)
* Try workaround for percy snapshot * Return our modified document * test: some dark magic to make it possible to take screenshots of WebGL canvases * Apply transformation directly to test DOM * investigate: window:before:load * Register flag in correct place; add experimental-webgl check * Remaining canvas fixes * Remove comment
This commit is contained in:
1 parent
f0519920fa
commit
70532a6cc6
6 files changed
+81
-31
No files matched your search
@@ -21,7 +21,6 @@ describe('OHIF Microscopy Extension', () => {
|
||||
.should('be.eq', 1);
|
||||
|
||||
cy.wait(3000); //Waiting for image to render before taking the snapshot
|
||||
cy.screenshot();
|
||||
cy.percyCanvasSnapshot('Microscopy Extension');
|
||||
});
|
||||
});
|
||||
@@ -20,7 +20,8 @@ describe('OHIF PDF Extension', () => {
|
||||
.its('length')
|
||||
.should('be.eq', 1);
|
||||
|
||||
cy.screenshot();
|
||||
// This won't work unless we switch to an extension that renders using `canvas`
|
||||
// Currently, we rely on the browser's built-in implementation
|
||||
cy.percyCanvasSnapshot('PDF Extension');
|
||||
});
|
||||
});
|
||||
@@ -22,14 +22,20 @@ describe('OHIF VTK Extension', () => {
|
||||
btn.click();
|
||||
}
|
||||
});
|
||||
//wait VTK toolbar and images to be loaded
|
||||
cy.wait(3000);
|
||||
|
||||
cy.initVTKToolsAliases();
|
||||
});
|
||||
|
||||
it('checks if VTK buttons are displayed on the toolbar', () => {
|
||||
cy.screenshot();
|
||||
cy.percyCanvasSnapshot('VTK Extension');
|
||||
// Wait for start reformatting
|
||||
cy.get('[data-cy="viewprt-grid"]', { timeout: 10000 }).should($grid => {
|
||||
expect($grid).to.contain.text('Reform');
|
||||
});
|
||||
|
||||
// Wait for finish reformatting
|
||||
cy.get('[data-cy="viewprt-grid"]', { timeout: 30000 }).should($grid => {
|
||||
expect($grid).not.to.contain.text('Reform');
|
||||
});
|
||||
|
||||
cy.get('@crosshairsBtn')
|
||||
.should('be.visible')
|
||||
@@ -50,5 +56,8 @@ describe('OHIF VTK Extension', () => {
|
||||
cy.get('@layoutBtn')
|
||||
.should('be.visible')
|
||||
.contains('Layout');
|
||||
|
||||
cy.wait(3000);
|
||||
cy.percyCanvasSnapshot('VTK Extension');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user