ohif-viewer/platform/viewer/cypress/integration/study-list/OHIFStudyList.spec.js
Bill Wallace 2327b4ae12 feat: Add Static WADO display (#2499)
* Rebased to have just the static view changes

* Changes based on the PR

* Couple more changes for the PR

* Removed an extraneous log

* Fix the study worklist display when returning to the page

* Added some documentation on the static wado data source setup, and a
bounds check change on the Queue test which was failing

* PR updates - change the undefined study description to '' and remove the aws deploy

* Fixed the e2e tests to actually pass/fail correctly on actual results
2021-08-24 17:53:03 -04:00

117 lines
3.9 KiB
JavaScript

//We are keeping the hardcoded results values for the study list tests
//this is intended to be running in a controled docker environment with test data.
describe('OHIF Study List', function () {
context('Desktop resolution', function () {
before(function () {
cy.openStudyList();
});
beforeEach(function () {
cy.viewport(1750, 720);
cy.initStudyListAliasesOnDesktop();
//Clear all text fields
cy.get('@PatientName').clear();
cy.get('@MRN').clear();
cy.get('@AccessionNumber').clear();
cy.get('@StudyDescription').clear();
// TODO: Find out how to clear this input
// select-2 / react-select has some specific ways
// to trigger things
//cy.get('@modalities')
});
it('Displays several studies initially', function () {
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.greaterThan(1);
expect($list).to.contain('Juno');
expect($list).to.contain('832040');
});
});
it('searches Patient Name with exact string', function () {
cy.get('@PatientName').type('Juno');
//Wait result list to be displayed
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.eq(1);
expect($list).to.contain('Juno');
});
});
/* TODO - re-enable this once the test server is fixed to allow searching by mrn
it('searches MRN with exact string', function () {
cy.get('@MRN').type('0000003');
//Wait result list to be displayed
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.eq(1);
expect($list).to.contain('0000003');
});
});
*/
it('searches Accession with exact string', function () {
cy.get('@AccessionNumber').type('0000155811');
//Wait result list to be displayed
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.eq(1);
expect($list).to.contain('0000155811');
});
});
// TODO: need to be able to programmatically change react-select
/*it('searches Modality with camel case', function() {
cy.get('@modalities').type('Ct');
//Wait result list to be displayed
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.greaterThan(1);
expect($list).to.contain('CT');
});
});*/
/*
TODO: Currently broken in dicomweb-server
it('searches Description with exact string', function() {
cy.get('@StudyDescription').type('PETCT');
//Wait result list to be displayed
cy.waitStudyList();
cy.get('@searchResult2').should($list => {
expect($list.length).to.be.eq(1);
expect($list).to.contain('PETCT');
});
});
*/
// TODO: need to be able to programmatically change react-select
/*it('changes Rows per page and checks the study count', function() {
//Show Rows per page options
const pageRows = [25, 50, 100];
//Check all options of Rows
pageRows.forEach(numRows => {
cy.get('select').select(numRows.toString()); //Select Rows per page option
//Wait result list to be displayed
cy.waitStudyList().then(() => {
//Compare the search result with the Study Count on the table header
cy.get('@numStudies')
.should(numStudies => {
expect(parseInt(numStudies.text())).to.be.at.most(numRows); //less than or equals to
})
.then(numStudies => {
//Compare to the number of Rows in the search result
cy.get('@searchResult2').then($searchResult => {
let countResults = $searchResult.length;
expect(numStudies.text()).to.be.eq(countResults.toString());
});
});
});
});
});
*/
});
});