Skip to content

Commit

Permalink
Merge branch 'maps-qc' into e2e-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ddjnw1yu committed Nov 20, 2023
2 parents 24675da + 92fc913 commit d544dbb
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/cypress/e2e/mapviewer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand All @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d544dbb

Please sign in to comment.