Skip to content

Commit

Permalink
fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer committed May 31, 2023
1 parent 967d754 commit 9f97bf1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 50 deletions.
2 changes: 1 addition & 1 deletion e2e_tests/integration/composite-db.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('composite database', () => {
) {
it('can query composite db and show results', () => {
cy.executeCommand(':clear')
const query = `create database compdb1;create database compdb2;use compdb1 create (:Poke {{}name: "Treecko"{}})-[:EVOLVES_INTO]->(:Poke {{}name: "Grovyle"{}});CREATE COMPOSITE DATABASE both;CREATE ALIAS both.cd1 FOR DATABASE compdb1;CREATE ALIAS both.cd2 FOR DATABASE compdb2;`
const query = `create database compdb1 if not exists;create database compdb2 if not exists;use compdb1 create (:Poke {{}name: "Treecko"{}})-[:EVOLVES_INTO]->(:Poke {{}name: "Grovyle"{}});CREATE COMPOSITE DATABASE both;CREATE ALIAS both.cd1 FOR DATABASE compdb1;CREATE ALIAS both.cd2 FOR DATABASE compdb2;`

cy.executeCommand(query)
cy.get('[data-testid="multi-statement-list-icon"]')
Expand Down
49 changes: 0 additions & 49 deletions e2e_tests/integration/viz.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,53 +241,4 @@ describe('Viz rendering', () => {
cy.get('#svg-vis').trigger('wheel', { deltaY: 3000, shiftKey: true })
cy.get(`[aria-label="zoom-out"]`).should('be.disabled')
})
it('can handle lots of property values and labels in node properties panel', () => {
const numberOfProps = 50
const numberOfLabels = 50
const queryLabels = Array.from({ length: numberOfLabels }, (x, i) => {
return `:label${i}`
}).join(' ')
const queryProps = Array.from({ length: numberOfProps }, (x, i) => {
return `prop${i}: 'hejsan'`
}).join(', ')
const query = `CREATE (nodeWithLotsOfProps ${queryLabels} { ${queryProps} }) RETURN nodeWithLotsOfProps`
cy.executeCommand(':clear')

// Directly set text to avoid waiting for ever when typing all chars
const editorTextarea = '#monaco-main-editor textarea'
cy.get(editorTextarea).click()
cy.get(editorTextarea).focus()
cy.get(editorTextarea)
.then(elem => {
elem.val(query)
})
.type(' {ENTER}')

// Scroll to bottom after labels loaded
const lastLabel = `label${numberOfLabels - 1}`
cy.get('[data-testid="vizInspector"]', { timeout: 5000 })
.contains(lastLabel)
.scrollIntoView()
.should('be.visible')

const showAllButtonText = 'Show all'
cy.get(`button:contains("${showAllButtonText}")`)
.scrollIntoView()
.should('be.visible')

// Open node properties details panel
const nodeSelector = '.node'
cy.get(nodeSelector).click()

const selectorPropsTable =
'[data-testid="viz-details-pane-properties-table"]'
cy.get(selectorPropsTable).should('be.visible')

const lastPropName = 'prop9'
cy.contains(lastPropName).should('exist')

// For some reason need to get to the td to be able to scroll to it, hence the parent()
cy.get('[data-testid="viz-details-pane-body"]').scrollTo('bottom')
cy.get('tr td span').contains(lastPropName).should('be.visible')
})
})

0 comments on commit 9f97bf1

Please sign in to comment.