Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ddjnw1yu committed Dec 12, 2024
1 parent 29310fd commit 6393536
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/cypress/e2e/databrowser.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/datasets/datasetInfo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/cypress/e2e/datasets/detailtabs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6393536

Please sign in to comment.