From 7a0c369006df1d1c2993d6469d4e7859e58c73d5 Mon Sep 17 00:00:00 2001 From: Mirna Silva Date: Thu, 12 Dec 2019 03:05:45 -0300 Subject: [PATCH] test: PT/CT json, studies, series, frames, metadatas (#1145) * Tests for routes: PT/CT json, studies, series, frames, metadatas * Fix based on reviews and JSON file for PT/CT Study added * chore: revert to remote JSON file * chore: delete PTCTStudy.json file We can circle back to this approach when/if we have issues. No need to hold-up this PR. My fault on this one. --- .../integration/common/OHIFRoutes.spec.js | 22 +++++++++++++++++ .../integration/common/ViewerRouting.spec.js | 24 ------------------- 2 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 platform/viewer/cypress/integration/common/OHIFRoutes.spec.js delete mode 100644 platform/viewer/cypress/integration/common/ViewerRouting.spec.js diff --git a/platform/viewer/cypress/integration/common/OHIFRoutes.spec.js b/platform/viewer/cypress/integration/common/OHIFRoutes.spec.js new file mode 100644 index 000000000..fd411f917 --- /dev/null +++ b/platform/viewer/cypress/integration/common/OHIFRoutes.spec.js @@ -0,0 +1,22 @@ +//We excluded the tests for '**/studies/**' because the bulk/all of our other study/viewer tests use this route + +describe('OHIF Routes', function() { + beforeEach(function() { + cy.openStudyList(); + }); + + it('checks PT/CT json url study route', function() { + cy.visit('/viewer?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/JSON/PTCTStudy.json'); + + cy.server(); + cy.route('GET', '**/PTCTStudy/**').as('getPTCTStudy'); + + cy.wait('@getPTCTStudy.all'); + cy.get('@getPTCTStudy').should($route => { + expect($route.status).to.be.eq(200); + }); + + cy.screenshot(); + cy.percyCanvasSnapshot('PT/CT json study route'); + }); +}); diff --git a/platform/viewer/cypress/integration/common/ViewerRouting.spec.js b/platform/viewer/cypress/integration/common/ViewerRouting.spec.js deleted file mode 100644 index d4e1a7494..000000000 --- a/platform/viewer/cypress/integration/common/ViewerRouting.spec.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('ViewerRouting', () => { - beforeEach(() => { - cy.visit('/'); - cy.contains('Study List'); - cy.get( - '[data-cy="study-list-results"]> :nth-child(1) > .patientId' - ).click(); - }); - - // it('thumbnails list has more than 2 items', () => { - // cy.get('.scrollable-study-thumbnails div.thumbnail-container') - // .its('length') - // .should('be.gte', 2); - // }); - - // it('loads route with at least 2 thumbnails', () => { - // cy.get( - // ':nth-child(1) > .ThumbnailEntry > .p-x-1 > .ImageThumbnail > .image-thumbnail-canvas > canvas' - // ).should('be.visible'); - // cy.get( - // ':nth-child(2) > .ThumbnailEntry > .p-x-1 > .ImageThumbnail > .image-thumbnail-canvas > canvas' - // ).should('be.visible'); - // }); -});