From 92fc91368855c9c892714a7cf5f41b08bae32d78 Mon Sep 17 00:00:00 2001 From: ddjnw1yu Date: Mon, 20 Nov 2023 20:07:04 +1300 Subject: [PATCH] fix provenance card testing --- test/cypress/e2e/mapviewer.cy.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/cypress/e2e/mapviewer.cy.js b/test/cypress/e2e/mapviewer.cy.js index e60f0f91..0dd501c0 100644 --- a/test/cypress/e2e/mapviewer.cy.js +++ b/test/cypress/e2e/mapviewer.cy.js @@ -16,25 +16,27 @@ describe('Maps Viewer', { testIsolation: false }, function () { taxonModels.forEach((model) => { it(`Provenance card for ${model}`, function () { - cy.intercept('**/flatmap/**').as('flatmap') - // Loading mask should not exist after the default flatmap is loaded cy.get('.multi-container > .el-loading-parent--relative > .el-loading-mask', { timeout: 30000 }).should('not.exist') - cy.get('#flatmap-select').click() - cy.get('.el-select-dropdown__item').should('be.visible') - cy.get('.el-select-dropdown__item:visible').contains(new RegExp(model, 'i')).click({ force: true }) + if (model !== 'Rat') { + cy.intercept('**/flatmap/**').as('flatmap') - cy.wait('@flatmap', { timeout: 20000 }) + // Switch to the second flatmap + cy.get('#flatmap-select').click() + cy.get('.el-select-dropdown__item').should('be.visible') + cy.get('.el-select-dropdown__item:visible').contains(new RegExp(model, 'i')).click({ force: true }) + cy.wait('@flatmap', { timeout: 20000 }) - // Loading mask should not exist after the new flatmap is loaded - cy.get('.multi-container > .el-loading-parent--relative > .el-loading-mask', { timeout: 30000 }).should('not.exist') + // Loading mask should not exist after the new flatmap is loaded + cy.get('.multi-container > .el-loading-parent--relative > .el-loading-mask', { timeout: 30000 }).should('not.exist') + } // Open a provenance card cy.get('[style="height: 100%;"] > [style="height: 100%; width: 100%; position: relative;"] > [style="height: 100%; width: 100%;"] > .maplibregl-touch-drag-pan > .maplibregl-canvas').click(); // Check for the popover provenance card content - cy.get('.maplibregl-popup-content > .tooltip-container > .el-main').within(() => { + cy.get('.maplibregl-popup-content > .tooltip-container > .el-main', { timeout: 30000 }).within(() => { cy.get('.title').should('exist') cy.get('.subtitle').should('exist') cy.get('.attribute-title').contains(/COMPONENTS/i).should('exist') @@ -74,6 +76,7 @@ describe('Maps Viewer', { testIsolation: false }, function () { cy.get('.title').contains(/3D human whole-body/i).should('exist') cy.get('p').contains(/Visualization/i).should('exist') cy.get('.subtitle').contains(/Scaffold Views/i).should('exist') + cy.get('.view-description').contains(/Human whole-body/i).should('exist') }) // Close the pathway sidebar @@ -87,6 +90,8 @@ describe('Maps Viewer', { testIsolation: false }, function () { // Check for keyword(highlighted part) in displayed viewers cy.get('.maplibregl-popup-content').contains(new RegExp(searchInput, 'i')).should('exist') + + cy.visit('/maps?type=ac') }) datasetIds.forEach((datasetId) => { @@ -116,9 +121,8 @@ describe('Maps Viewer', { testIsolation: false }, function () { cy.wait(['@dataset_info', '@datasets'], { timeout: 20000 }) // Check for search result and the tag 'Scaffold' - cy.get('.dataset-card').contains(datasetId).should('exist') - cy.get('.dataset-card').filter(`:contains(${datasetId})`).within(() => { - cy.get('.container', { timeout: 30000 }).contains(/Scaffold/i).should('exist') + cy.get('.dataset-card', { timeout: 30000 }).filter(`:contains(${datasetId})`).within(() => { + cy.get('.container').contains(/Scaffold/i).should('exist') }) // Close the sidebar