From b64eef9b7f50399991557233fabe63b158a9ce6b Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 10 May 2024 11:58:22 +1200 Subject: [PATCH 1/5] fix issue when same species used for tests --- tests/cypress/e2e/mapsviewer.cy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cypress/e2e/mapsviewer.cy.js b/tests/cypress/e2e/mapsviewer.cy.js index 5645ff59..73cc32eb 100644 --- a/tests/cypress/e2e/mapsviewer.cy.js +++ b/tests/cypress/e2e/mapsviewer.cy.js @@ -69,9 +69,10 @@ 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 }) - - cy.waitForLoadingMask() + if (threeDSyncView !== taxonModels[taxonModels.length - 1]) { + 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') From ab55027da5bbd5967c706cd256a7dcec50917c40 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 10 May 2024 12:50:27 +1200 Subject: [PATCH 2/5] avoid duplicate inputs --- tests/cypress/e2e/databrowser.cy.js | 2 +- tests/cypress/e2e/datasets.cy.js | 2 +- tests/cypress/e2e/mapsviewer.cy.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cypress/e2e/databrowser.cy.js b/tests/cypress/e2e/databrowser.cy.js index 6b9fd65d..3d75ccd8 100644 --- a/tests/cypress/e2e/databrowser.cy.js +++ b/tests/cypress/e2e/databrowser.cy.js @@ -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 diff --git a/tests/cypress/e2e/datasets.cy.js b/tests/cypress/e2e/datasets.cy.js index 541c1bf3..330749b1 100644 --- a/tests/cypress/e2e/datasets.cy.js +++ b/tests/cypress/e2e/datasets.cy.js @@ -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 => { diff --git a/tests/cypress/e2e/mapsviewer.cy.js b/tests/cypress/e2e/mapsviewer.cy.js index 73cc32eb..1b94513d 100644 --- a/tests/cypress/e2e/mapsviewer.cy.js +++ b/tests/cypress/e2e/mapsviewer.cy.js @@ -7,7 +7,7 @@ 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))] /** * Name of species for the 3D sync map @@ -17,7 +17,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 () { From 85505e4e3d32130c0a82fed452d41d45634b1dce Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 10 May 2024 13:00:55 +1200 Subject: [PATCH 3/5] no need to wait flatmap which already loaded --- tests/cypress/e2e/mapsviewer.cy.js | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/cypress/e2e/mapsviewer.cy.js b/tests/cypress/e2e/mapsviewer.cy.js index 1b94513d..2ea9bc48 100644 --- a/tests/cypress/e2e/mapsviewer.cy.js +++ b/tests/cypress/e2e/mapsviewer.cy.js @@ -8,6 +8,7 @@ const pixelChange = 3 * Human Female, Human Male, Rat, Mouse, Pig, Cat */ 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 @@ -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 }) @@ -69,9 +76,12 @@ 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 }) - if (threeDSyncView !== taxonModels[taxonModels.length - 1]) { + if (!loadedModels.has(threeDSyncView)) { + cy.wait('@flatmap', { timeout: 20000 }) + cy.waitForLoadingMask() + } // Open the 3D view in a split viewer @@ -142,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() From a9d54c1d54efcc09e14b3764b542befa490f2df7 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 10 May 2024 13:04:23 +1200 Subject: [PATCH 4/5] remove rat option from THREE_SYNC_VIEW --- .github/workflows/cypress_timeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cypress_timeline.yml b/.github/workflows/cypress_timeline.yml index acb7590a..e7a8e9a6 100644 --- a/.github/workflows/cypress_timeline.yml +++ b/.github/workflows/cypress_timeline.yml @@ -58,7 +58,6 @@ on: options: - "Human Female" - "Human Male" - - "Rat" SEARCH_IN_MAP: description: "Define keyword" required: true From 073e43db82e88a2089e660a31a68a6d41fe957b6 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 10 May 2024 13:07:09 +1200 Subject: [PATCH 5/5] reorder options --- .github/workflows/cypress_timeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress_timeline.yml b/.github/workflows/cypress_timeline.yml index e7a8e9a6..b88b7b89 100644 --- a/.github/workflows/cypress_timeline.yml +++ b/.github/workflows/cypress_timeline.yml @@ -56,8 +56,8 @@ on: description: "Define species for sync map" required: true options: - - "Human Female" - "Human Male" + - "Human Female" SEARCH_IN_MAP: description: "Define keyword" required: true