Skip to content

Commit

Permalink
Fix closing drawer in cypress tests (#498)
Browse files Browse the repository at this point in the history
* Fix closing drawer in cypress tests

When loading an assembly close the drawer of jobs tasks *before*
reloading the page since occasionally the drawer is already closed after
reloading.

* Close drawer if you can find it; increase viewport width
  • Loading branch information
dariober authored Dec 18, 2024
1 parent 387b544 commit 2fd0f84
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/jbrowse-plugin-apollo/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = defineConfig({
// Make viewport long and thin to avoid the scrollbar on the right interfere
// with the coordinates
viewportHeight: 2000,
viewportWidth: 1000,
viewportWidth: 1300,
retries: {
runMode: 2,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Different ways of editing features', () => {
cy.deleteAssemblies()
})

it.skip('Edit feature via table editor', () => {
it('Edit feature via table editor', () => {
const assemblyName = 'space.gff3'
cy.addAssemblyFromGff(assemblyName, `test_data/${assemblyName}`)
cy.selectAssemblyToView(assemblyName)
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Different ways of editing features', () => {
})
})

it.skip('Can add gene ontology attribute', () => {
it('Can add gene ontology attribute', () => {
cy.addAssemblyFromGff('onegene.fasta.gff3', 'test_data/onegene.fasta.gff3')
cy.selectAssemblyToView('onegene.fasta.gff3')
cy.searchFeatures('gx1', 1)
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('Different ways of editing features', () => {
cy.contains('td', 'Gene Ontology=GO:0044838')
})

it.only('FIXME: Can delete feature with checks', () => {
it('FIXME: Can delete feature with checks', () => {
cy.addAssemblyFromGff('stopcodon', 'test_data/cdsChecks/stopcodon.gff3')
cy.selectAssemblyToView('stopcodon')
cy.searchFeatures('gene02', 1)
Expand Down
8 changes: 7 additions & 1 deletion packages/jbrowse-plugin-apollo/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,16 @@ Cypress.Commands.add('addAssemblyFromGff', (assemblyName, fin) => {
cy.contains('AddAssemblyAndFeaturesFromFileChange')
.parent()
.should('contain', 'All operations successful')
// cy.get('button[aria-label="Close drawer"]', { timeout: 20_000 }).click()
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000)
cy.reload()
cy.get('button[aria-label="Close drawer"]', { timeout: 20_000 }).click()
// If the drawer is still open close it
cy.get('body').then(($body) => {
if ($body.find('button[aria-label="Close drawer"]').length > 0) {
cy.get('button[aria-label="Close drawer"]').click()
}
})
cy.contains('Select assembly to view', { timeout: 10_000 })
})

Expand Down

0 comments on commit 2fd0f84

Please sign in to comment.