feat(test): Playwright testing integration (#4146)
This commit is contained in:
1 parent
856cd17531
commit
fe1a706446
26 files changed
+434
-215
No files matched your search
@@ -1,25 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy Layout Advanced Presets', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer('1.3.6.1.4.1.25403.345050719074.3824.20170125113417.1');
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(3);
|
||||
});
|
||||
|
||||
it('should display each layout preset correctly', () => {
|
||||
cy.get('[data-cy="study-browser-thumbnail"]').eq(2).dblclick();
|
||||
cy.selectLayoutPreset('MPR', true);
|
||||
cy.percyCanvasSnapshot('MPR Preset');
|
||||
cy.selectLayoutPreset('3D four up');
|
||||
cy.percyCanvasSnapshot('3D four up Preset');
|
||||
cy.selectLayoutPreset('3D main');
|
||||
cy.percyCanvasSnapshot('3D main Preset');
|
||||
cy.selectLayoutPreset('Axial Primary');
|
||||
cy.percyCanvasSnapshot('Axial Primary Preset');
|
||||
cy.selectLayoutPreset('3D only');
|
||||
cy.percyCanvasSnapshot('3D only Preset');
|
||||
cy.selectLayoutPreset('3D primary');
|
||||
cy.percyCanvasSnapshot('3D primary Preset');
|
||||
});
|
||||
});
|
||||
@@ -1,31 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy MPR Crosshairs', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer(
|
||||
'1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
|
||||
'&hangingProtocolId=default',
|
||||
'/viewer'
|
||||
);
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(4);
|
||||
});
|
||||
|
||||
it('should enabled crosshairs in MPR and reset them when another series is loaded', () => {
|
||||
cy.get('[data-cy="study-browser-thumbnail"]').eq(2).dblclick();
|
||||
cy.selectLayoutPreset('MPR');
|
||||
cy.get('[data-cy="Crosshairs"]').click();
|
||||
cy.wait(500);
|
||||
cy.percyCanvasSnapshot('Crosshairs enabled');
|
||||
cy.wait(100);
|
||||
cy.get('[data-viewport-uid="mpr-axial"] > .viewport-element > .cornerstone-canvas').click(
|
||||
45,
|
||||
100
|
||||
);
|
||||
cy.wait(200);
|
||||
cy.percyCanvasSnapshot('Crosshairs are moved');
|
||||
cy.get('[data-cy="study-browser-thumbnail"]').eq(0).dblclick();
|
||||
cy.wait(500);
|
||||
cy.percyCanvasSnapshot('Another series dropped, Crosshairs are centered');
|
||||
});
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy PDF Display', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer('1.2.826.0.13854362241694438965858641723883466450351448');
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(1);
|
||||
});
|
||||
|
||||
it('should display PDFs correctly', () => {
|
||||
cy.percyCanvasSnapshot('PDF');
|
||||
});
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy SR', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer('1.2.840.113619.2.5.1762583153.215519.978957063.78');
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(3);
|
||||
});
|
||||
|
||||
it('should hydrate SR correctly and Jump to Measurements', () => {
|
||||
cy.get('[data-cy="study-browser-thumbnail-no-image"]').first().dblclick();
|
||||
cy.wait(200);
|
||||
cy.percyCanvasSnapshot('SR Preview');
|
||||
cy.get('body').type('{enter}');
|
||||
cy.wait(200);
|
||||
cy.percyCanvasSnapshot('SR Hydrated');
|
||||
cy.get('[data-cy="trackedMeasurements-btn"]').click();
|
||||
cy.percyCanvasSnapshot('Opened Measurement Panel');
|
||||
cy.get('body').type('{downarrow}');
|
||||
cy.get('body').type('{downarrow}');
|
||||
cy.get('body').type('{downarrow}');
|
||||
cy.percyCanvasSnapshot('Scrolled away from measurements');
|
||||
cy.get('[data-cy="measurement-item"]').first().click();
|
||||
cy.percyCanvasSnapshot('Jumped to Measurement');
|
||||
});
|
||||
});
|
||||
@@ -1,42 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy Segmentation Tools', () => {
|
||||
beforeEach(() => {
|
||||
Cypress.on('uncaught:exception', () => false);
|
||||
cy.openStudyInViewer(
|
||||
'1.3.6.1.4.1.25403.345050719074.3824.20170125113417.1',
|
||||
'&hangingProtocolId=default',
|
||||
'/segmentation'
|
||||
);
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(3);
|
||||
});
|
||||
|
||||
it('should be able to use all segmentation tools and have them render correctly', () => {
|
||||
cy.get('[data-cy="study-browser-thumbnail"]').eq(1).dblclick();
|
||||
cy.percyCanvasSnapshot('Segmentation tools are disabled');
|
||||
cy.get('span').contains('Add segmentation').should('have.css', 'pointer-events', 'none');
|
||||
cy.percyCanvasSnapshot(
|
||||
'Add segmentation button is disabled when the displayset is none reconstructable'
|
||||
);
|
||||
cy.get('[data-cy="study-browser-thumbnail"]').eq(2).dblclick();
|
||||
cy.get('span').contains('Add segmentation').click();
|
||||
cy.wait(500);
|
||||
cy.percyCanvasSnapshot('Segmentation added and tools are enabled');
|
||||
cy.get('[data-cy="Brush"]').click();
|
||||
cy.percyCanvasSnapshot('Brush tool selected');
|
||||
cy.addBrush('.cornerstone-canvas');
|
||||
cy.percyCanvasSnapshot('Brush tool applied');
|
||||
cy.get('[data-cy="Eraser"]').click();
|
||||
cy.percyCanvasSnapshot('Eraser tool selected');
|
||||
cy.addEraser('.cornerstone-canvas');
|
||||
cy.percyCanvasSnapshot('Eraser tool applied');
|
||||
cy.selectLayoutPreset('MPR');
|
||||
cy.get('[data-cy="Brush"]').click();
|
||||
cy.percyCanvasSnapshot('Brush tool selected in MPR');
|
||||
cy.get('button').contains('Sphere').click();
|
||||
cy.percyCanvasSnapshot('Sphere mode for Brush tool selected');
|
||||
cy.addBrush('[data-viewport-uid="mpr-axial"] > .viewport-element > .cornerstone-canvas');
|
||||
cy.percyCanvasSnapshot('Sphere stroke for Brush tool applied');
|
||||
});
|
||||
});
|
||||
@@ -1,38 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy TMTV', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer(
|
||||
'1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
|
||||
'',
|
||||
'/tmtv'
|
||||
);
|
||||
cy.wait(10000);
|
||||
});
|
||||
|
||||
it('should maintain VOI when going 1 up and back', () => {
|
||||
cy.percyCanvasSnapshot('TMTV Loaded');
|
||||
cy.get('[data-viewport-uid="mipSagittal"] > .viewport-element > .cornerstone-canvas').dblclick(
|
||||
100,
|
||||
100
|
||||
);
|
||||
cy.wait(500);
|
||||
cy.percyCanvasSnapshot('TMTV One up view loaded');
|
||||
cy.get('[data-viewport-uid="mipSagittal"] > .viewport-element > .cornerstone-canvas').dblclick(
|
||||
100,
|
||||
100
|
||||
);
|
||||
cy.wait(500);
|
||||
cy.percyCanvasSnapshot('TMTV Back to original view');
|
||||
});
|
||||
|
||||
it('should still look fine when changing patient data', () => {
|
||||
cy.get('[data-cy="petSUV-btn"]').click();
|
||||
cy.percyCanvasSnapshot('TMTV Patient Panel Opened');
|
||||
cy.get('[data-cy="input-weight-input"]').type('191');
|
||||
cy.percyCanvasSnapshot('TMTV Patient Panel Weight Changed');
|
||||
cy.get('button').contains('Reload Data').click();
|
||||
cy.wait(5000);
|
||||
cy.percyCanvasSnapshot('TMTV Reloaded Data');
|
||||
});
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
import '@percy/cypress';
|
||||
|
||||
describe('OHIF Percy Video Display', () => {
|
||||
beforeEach(() => {
|
||||
cy.openStudyInViewer('2.25.96975534054447904995905761963464388233');
|
||||
cy.wait(5000);
|
||||
cy.expectMinimumThumbnails(0);
|
||||
});
|
||||
|
||||
it('should display Videos correctly', () => {
|
||||
cy.percyCanvasSnapshot('Video');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user