Compare commits

...
Author SHA1 Message Date
ohif-bot 3bbeb1c521 chore(release): publish [skip ci]
- @ohif/viewer@1.11.5
2019-10-24 20:23:16 +00:00
Danny Brown 7668b69f20 test: percy snapshot workaround (#1085)
* Try workaround for percy snapshot

* Return our modified document
2019-10-24 16:09:59 -04:00
Danny Brown 3a12138134 test: Try workaround for percy snapshot (#1084) 2019-10-24 15:54:06 -04:00
Danny Brown 97786b808c ci: revert flags 2019-10-23 12:55:39 -04:00
Danny Brown cd1baa1b36 ci: force flag 2019-10-23 12:41:44 -04:00
Danny Brown 3ae3bee452 ci: test recursive removal 2019-10-23 12:24:56 -04:00
8 changed files with 45 additions and 6 deletions

No files matched your search

+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.11.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.11.4...@ohif/viewer@1.11.5) (2019-10-24)
**Note:** Version bump only for package @ohif/viewer
## [1.11.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.11.3...@ohif/viewer@1.11.4) (2019-10-23)
@@ -5,7 +5,7 @@ describe('OHIFStandaloneViewer', () => {
it('loads route with at least 2 rows', () => {
cy.screenshot();
cy.percySnapshot();
cy.percyCanvasSnapshot('Study List');
cy.get('#studyListData tr')
.its('length')
@@ -12,7 +12,7 @@ describe('OHIF Study Viewer Page', () => {
it('checks if series thumbnails are being displayed', () => {
cy.screenshot();
cy.percySnapshot();
cy.percyCanvasSnapshot('Series Thumbnails');
cy.get('[data-cy="thumbnail-list"]')
.its('length')
@@ -22,6 +22,6 @@ describe('OHIF Microscopy Extension', () => {
cy.wait(3000); //Waiting for image to render before taking the snapshot
cy.screenshot();
cy.percySnapshot();
cy.percyCanvasSnapshot('Microscopy Extension');
});
});
@@ -21,6 +21,6 @@ describe('OHIF PDF Extension', () => {
.should('be.eq', 1);
cy.screenshot();
cy.percySnapshot();
cy.percyCanvasSnapshot('PDF Extension');
});
});
@@ -29,7 +29,7 @@ describe('OHIF VTK Extension', () => {
it('checks if VTK buttons are displayed on the toolbar', () => {
cy.screenshot();
cy.percySnapshot();
cy.percyCanvasSnapshot('VTK Extension');
cy.get('@crosshairsBtn')
.should('be.visible')
@@ -306,3 +306,34 @@ Cypress.Commands.add('isInViewport', element => {
}
});
});
/**
* Percy.io Canvas screenshot workaround
*
*/
Cypress.Commands.add('percyCanvasSnapshot', (name, options = {}) => {
function convertCanvas(documentClone) {
documentClone
.querySelectorAll('canvas')
.forEach(selector => canvasToImage(selector));
return documentClone;
}
function canvasToImage(selectorOrEl) {
let canvas =
typeof selectorOrEl === 'object'
? selectorOrEl
: document.querySelector(selectorOrEl);
let image = document.createElement('img');
let canvasImageBase64 = canvas.toDataURL();
image.src = canvasImageBase64;
image.style = 'max-width: 100%';
canvas.setAttribute('data-percy-modified', true);
canvas.parentElement.appendChild(image);
canvas.style = 'display: none';
}
cy.percySnapshot(name, { ...options, domTransformation: convertCanvas });
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "1.11.4",
"version": "1.11.5",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",