Skip to content

Commit

Permalink
removed check for projects on data page since it has been moved
Browse files Browse the repository at this point in the history
  • Loading branch information
egauzens committed May 13, 2024
1 parent 0fe880c commit e292257
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions tests/cypress/e2e/databrowser.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const browseCategories = ['dataset', 'model', 'simulation', 'projects']
const browseCategories = ['dataset', 'model', 'simulation']

/**
* The number of datasets are displayed per page
Expand Down Expand Up @@ -49,20 +49,11 @@ browseCategories.forEach((category) => {
cy.wait('@query', { timeout: 20000 })
cy.wait('@entries', { timeout: 20000 })

if (category === 'projects') {
cy.get(':nth-child(1) > .el-table_1_column_1 > .cell > .image-container > .img-project').should('have.attr', 'src').and('contain', '//images.ctfassets.net/');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > .property-table > :nth-child(1) > .property-name-column').should('contain', 'Focus');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > .property-table > :nth-child(2) > .property-name-column').should('contain', 'Principle Investigator');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > .property-table > :nth-child(3) > .property-name-column').should('contain', 'Institution');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > .property-table > :nth-child(4) > .property-name-column').should('contain', 'Funding Program');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > .property-table > :nth-child(5) > .property-name-column').should('contain', 'Award');
} else {
cy.get(':nth-child(1) > .el-table_1_column_1 > .cell > :nth-child(1) > .img-dataset > img').should('have.attr', 'src').and('contain', 'https://assets.discover.pennsieve.io/dataset-assets/')
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(1) > .property-name-column').should('contain', 'Anatomical Structure');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(2) > .property-name-column').should('contain', 'Species');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(3) > .property-name-column').should('contain', 'Experimental Approach');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(4) > .property-name-column').should('contain', 'Publication Date');
}
cy.get(':nth-child(1) > .el-table_1_column_1 > .cell > :nth-child(1) > .img-dataset > img').should('have.attr', 'src').and('contain', 'https://assets.discover.pennsieve.io/dataset-assets/')
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(1) > .property-name-column').should('contain', 'Anatomical Structure');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(2) > .property-name-column').should('contain', 'Species');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(3) > .property-name-column').should('contain', 'Experimental Approach');
cy.get(':nth-child(1) > .el-table_1_column_2 > .cell > :nth-child(1) > .property-table > :nth-child(4) > .property-name-column').should('contain', 'Publication Date');
})

it('All Page Features', function () {
Expand Down Expand Up @@ -204,7 +195,7 @@ browseCategories.forEach((category) => {
facetList.forEach((facet) => {
facetIsObserved = facetIsObserved && $label.text().toLowerCase().includes(facet.toLowerCase())
})
if (!facetIsObserved && category !== 'projects') {
if (!facetIsObserved) {
// If the same facet are found in multiple place, the first will be checked by default
// This action is used to expand all parent facets in ANATOMICAL STRUCTURE
// To avoid facet not found when using child facets as test facets
Expand All @@ -218,7 +209,7 @@ browseCategories.forEach((category) => {
facetList.forEach((facet) => {
facetIsObserved = facetIsObserved && $label.text().toLowerCase().includes(facet.toLowerCase())
})
if (!facetIsObserved && category !== 'projects') {
if (!facetIsObserved) {
// If the same facet are found in multiple place, the first will be checked by default
// This action is used to expand all parent facets in ANATOMICAL STRUCTURE
// To avoid facet not found when using child facets as test facets
Expand All @@ -235,17 +226,9 @@ browseCategories.forEach((category) => {
})

// Check for URL
if (category === 'projects') {
cy.url().should('contain', 'selectedProjectsAnatomicalFocusIds')

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

} else {
cy.url().should('contain', 'selectedFacetIds')

cy.wait('@query', { timeout: 20000 })
cy.url().should('contain', 'selectedFacetIds')

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

cy.get('.table-wrap.el-loading-parent--relative > .el-loading-mask', { timeout: 30000 }).should('not.exist')

Expand Down

0 comments on commit e292257

Please sign in to comment.