Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wait issue when same species used in different tests #103

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/cypress_timeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ on:
description: "Define species for sync map"
required: true
options:
- "Human Female"
- "Human Male"
- "Rat"
- "Human Female"
SEARCH_IN_MAP:
description: "Define keyword"
required: true
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/databrowser.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const pageLimit = Cypress.env('PAGE_LIMIT')
/**
* List of keywords
*/
const searchKeywords = Cypress.env('SEARCH_KEYWORDS').split(',').map(item => item.trim()).filter(item => item)
const searchKeywords = [...new Set(Cypress.env('SEARCH_KEYWORDS').split(',').map(item => item.trim()).filter(item => item))]

/**
* List of facets
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/datasets.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* List of dataset ids
*/
const datasetIds = Cypress.env('DATASET_IDS').split(',').map(item => item.trim()).filter(item => item)
const datasetIds = [...new Set(Cypress.env('DATASET_IDS').split(',').map(item => item.trim()).filter(item => item))]

datasetIds.forEach(datasetId => {

Expand Down
43 changes: 27 additions & 16 deletions tests/cypress/e2e/mapsviewer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const pixelChange = 3
/**
* Human Female, Human Male, Rat, Mouse, Pig, Cat
*/
const taxonModels = Cypress.env('TAXON_MODELS').split(',').map(item => item.trim()).filter(item => item)
const taxonModels = [...new Set(Cypress.env('TAXON_MODELS').split(',').map(item => item.trim()).filter(item => item))]
let loadedModels = new Set()

/**
* Name of species for the 3D sync map
Expand All @@ -17,7 +18,7 @@ const threeDSyncView = Cypress.env('THREE_SYNC_VIEW')

const searchInMap = Cypress.env('SEARCH_IN_MAP')

const scaffoldDatasetIds = Cypress.env('SCAFFOLD_DATASET_IDS').split(',').map(item => item.trim()).filter(item => item)
const scaffoldDatasetIds = [...new Set(Cypress.env('SCAFFOLD_DATASET_IDS').split(',').map(item => item.trim()).filter(item => item))]

describe('Maps Viewer', { testIsolation: false }, function () {
before(function () {
Expand All @@ -33,22 +34,28 @@ describe('Maps Viewer', { testIsolation: false }, function () {
cy.intercept('**/datasets/**').as('datasets')
})

taxonModels.forEach((model) => {
taxonModels.forEach((model, index) => {

it(`Provenance card for ${model}`, function () {
if (model !== 'Rat') {

cy.waitForLoadingMask()

// Switch to the second flatmap
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger').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.waitForLoadingMask()

cy.wait('@flatmap', { timeout: 20000 })
// Switch to the second flatmap
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger').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.waitForLoadingMask()
if (!loadedModels.has(model)) {

cy.wait('@flatmap', { timeout: 20000 })

cy.waitForLoadingMask()

if (index === 0) {
loadedModels.add('Rat')
}
loadedModels.add(model)
}

// Hide organs and outlines
cy.get('.settings-group > :nth-child(2):visible').click({ waitForAnimations: false })
Expand All @@ -69,9 +76,13 @@ describe('Maps Viewer', { testIsolation: false }, function () {
cy.get('.el-select.select-box.el-tooltip__trigger.el-tooltip__trigger').click()
cy.get('.el-select-dropdown__item').contains(new RegExp(threeDSyncView, 'i')).click({ force: true })

cy.wait('@flatmap', { timeout: 20000 })
if (!loadedModels.has(threeDSyncView)) {

cy.waitForLoadingMask()
cy.wait('@flatmap', { timeout: 20000 })

cy.waitForLoadingMask()

}

// Open the 3D view in a split viewer
cy.get('.settings-group > :nth-child(1):visible').contains(/Open new map/i).should('exist')
Expand Down Expand Up @@ -141,7 +152,7 @@ describe('Maps Viewer', { testIsolation: false }, function () {
cy.get('.badges-container > .container', { timeout: 30000 }).contains(/Scaffold/i).should('exist')
cy.get('.badges-container > .container').contains(/Scaffold/i).click()
})

// Check for button text
cy.get('.dataset-card-container > .dataset-card', { timeout: 30000 }).contains(/View Scaffold/i).should('exist').click()

Expand Down