diff --git a/tests/cypress/e2e/databrowser.cy.js b/tests/cypress/e2e/databrowser.cy.js index 0ab8370..908c2fa 100644 --- a/tests/cypress/e2e/databrowser.cy.js +++ b/tests/cypress/e2e/databrowser.cy.js @@ -172,7 +172,7 @@ browseCategories.forEach((category, bcIndex) => { cy.get('.search-text').click() // Check for keyword in URL cy.url().should((url) => { - expect(url, 'URL should contain search keyword parameter').to.contain(`search=${keyword}`) + expect(url, 'URL should contain search keyword parameter').to.contain(`search=${keyword.replace(' ', '+')}`) }) cy.wait(5000) cy.wait('@query', { timeout: 20000 }).then((intercept) => { @@ -196,7 +196,7 @@ browseCategories.forEach((category, bcIndex) => { cy.get('.table-wrap').then(($table) => { const keywordExistInTable = $table.text().toLowerCase().includes(keyword.toLowerCase()) if (keywordExistInTable) { - cy.get('b').contains(new RegExp(keyword, 'i')).should(($keyword) => { + cy.get('b').contains(new RegExp('\(' + keyword.replace(' ', '|') + '\)', 'i')).should(($keyword) => { expect($keyword, 'Highlighted keyword should exist in table').to.exist }) } else { diff --git a/tests/cypress/e2e/datasets/datasetInfo.cy.js b/tests/cypress/e2e/datasets/datasetInfo.cy.js index 7d0b575..41c9aa5 100644 --- a/tests/cypress/e2e/datasets/datasetInfo.cy.js +++ b/tests/cypress/e2e/datasets/datasetInfo.cy.js @@ -103,7 +103,7 @@ datasetIds.forEach((datasetId) => { expect(url, 'URL should contain correct slug').to.contain('/about/projects/') }) // Check for the title - cy.get('.row > .heading2').should(($pTitle) => { + cy.get('.row > .heading2', { timeout: 60000 }).should(($pTitle) => { expect($pTitle, 'Project title should match').to.contain(title) }) cy.backToDetailPage(datasetId) diff --git a/tests/cypress/e2e/datasets/detailtabs.cy.js b/tests/cypress/e2e/datasets/detailtabs.cy.js index 8c3165a..9697d88 100644 --- a/tests/cypress/e2e/datasets/detailtabs.cy.js +++ b/tests/cypress/e2e/datasets/detailtabs.cy.js @@ -226,6 +226,8 @@ datasetIds.forEach((datasetId) => { } }) }) + }) + cy.get('@contact', { timeout: 60000 }).then(($content) => { cy.get('.about-section-container a').then(($email) => { cy.get('.dataset-owners').should(($contributors) => { const author = $content.text().replace($email.text(), '').replace('Contact Author:', '').replace(/[ ]+/g, ' ').trim() @@ -252,7 +254,7 @@ datasetIds.forEach((datasetId) => { const institution = $institution.text().replace('Institution(s):', '').trim() cy.wrap($project).find('a').click() cy.waitForPageLoading() - cy.get('.row > .heading2').should(($title) => { + cy.get('.row > .heading2', { timeout: 60000 }).should(($title) => { expect($title, 'Project title should be the same').to.contain(project) }) cy.get('span.label4').parent().contains(/INSTITUTION[(]S[)]/i).should(($institution) => { diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 094431b..d7b493c 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -235,7 +235,7 @@ Cypress.Commands.add('checkGalleyCardState', () => { cy.get('.cursor-pointer > .thumbnail').should(($image) => { expect($image, 'Image should be loaded').to.have.prop('naturalWidth').to.be.greaterThan(0) }) - cy.get('.details > .el-tooltip__trigger > .title').should(($title) => { + cy.get('.details > .el-tooltip__trigger > .title', { timeout: 30000 }).should(($title) => { expect($title, 'Title should exist').to.not.have.text('') }) cy.get('.details > .el-button').should(($button) => {