Skip to content

Commit

Permalink
Add connectivity graph e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ddjnw1yu committed Nov 17, 2024
1 parent 1ea8405 commit dab6da3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/cypress/e2e/mapsviewer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ describe('Maps Viewer', { testIsolation: false }, function () {
message: `Clicked on the ${$title.text()}`,
type: 'info'
})
cy.get('.el-button.copy-clipboard-button:visible').click()
cy.window().then(win => {
win.navigator.clipboard.readText().then(text => {
expect(text, 'The content should be copied to clipboard').to.contain($title.text().trim())
})
})
})
cy.get('.block > .subtitle').should(($description) => {
expect($description, 'The provenance card should have the neuron description').to.exist
Expand All @@ -122,6 +128,9 @@ describe('Maps Viewer', { testIsolation: false }, function () {
})
}
})
cy.get('.population-display > .buttons-row').as('populationDisplay')
// List view
cy.get('@populationDisplay').contains('List view').click()
// Check for the provenance button click
cy.get('.sidebar-container > .main > .content-container').then(($content) => {
cy.wrap($content).get('.attribute-title-container').should(($title) => {
Expand All @@ -143,6 +152,28 @@ describe('Maps Viewer', { testIsolation: false }, function () {
}
})
})
// Graph view
cy.get('@populationDisplay').contains('Graph view').click()
cy.waitForConnectivityGraphLoading()
cy.get('.connectivity-graph > .graph-canvas').then(($graph) => {
expect($graph, 'The connectivity graph should exist').to.exist
})
cy.get('.connectivity-graph > .control-panel-tools').then(($panelTools) => {
expect($panelTools, 'The control panel tools should exist').to.exist
})
cy.get('.tools > .control-button:visible').then(($tools) => {
expect($tools, 'The control panel tools should have 2').to.have.length(2)
})
cy.get('.tools > :nth-child(2).control-button:visible').click()
cy.get('.tools > .control-button:visible').then(($tools) => {
expect($tools, 'The more control panel tools should be displayed').to.have.length.greaterThan(2)
})
cy.get('.connectivity-graph > .control-panel-nodes').then(($panelNodes) => {
expect($panelNodes, 'The control panel nodes should exist').to.exist
cy.wrap($panelNodes).get('.node-key > .key-box-container > .key-box').then(($keys) => {
expect($keys, 'The control panel nodes should have at least one key').to.have.length.greaterThan(0)
})
})
// Close the provenance card
cy.get('.active-tab > .el-button').as('closeTabButton').click()
cy.get('.sidebar-container > .tab-container').should(($tab) => {
Expand Down
7 changes: 7 additions & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ Cypress.Commands.add('waitForViewerContainer', (selector) => {
cy.wait(5000)
})

Cypress.Commands.add('waitForConnectivityGraphLoading', () => {
cy.get('.connectivity-graph > .el-loading-mask > .el-loading-spinner', { timeout: 30000 }).should(($loadingMask) => {
expect($loadingMask, 'Connectivity graph loading mask should not exist').to.not.exist
})
cy.wait(5000)
})

/**
* Databrowser commands
*/
Expand Down

0 comments on commit dab6da3

Please sign in to comment.