From 276d71abf231ed54906aeafe6ecc2f6731f344b9 Mon Sep 17 00:00:00 2001 From: dariober Date: Tue, 17 Dec 2024 14:30:21 +0000 Subject: [PATCH 1/2] 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. --- packages/jbrowse-plugin-apollo/cypress/support/commands.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts index 5c071376c..f1c5581d4 100644 --- a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts +++ b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts @@ -119,10 +119,8 @@ Cypress.Commands.add('addAssemblyFromGff', (assemblyName, fin) => { cy.contains('AddAssemblyAndFeaturesFromFileChange') .parent() .should('contain', 'All operations successful') - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000) - cy.reload() cy.get('button[aria-label="Close drawer"]', { timeout: 20_000 }).click() + cy.reload() cy.contains('Select assembly to view', { timeout: 10_000 }) }) From 0421f04e9bfabd716f66996284c0439d7a9c2826 Mon Sep 17 00:00:00 2001 From: dariober Date: Tue, 17 Dec 2024 15:53:49 +0000 Subject: [PATCH 2/2] Close drawer if you can find it; increase viewport width --- packages/jbrowse-plugin-apollo/cypress.config.js | 2 +- .../cypress/e2e/editFeature.cy.ts | 6 +++--- .../jbrowse-plugin-apollo/cypress/support/commands.ts | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/jbrowse-plugin-apollo/cypress.config.js b/packages/jbrowse-plugin-apollo/cypress.config.js index 3e308d85e..2f5c2438e 100644 --- a/packages/jbrowse-plugin-apollo/cypress.config.js +++ b/packages/jbrowse-plugin-apollo/cypress.config.js @@ -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, }, diff --git a/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts b/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts index 1875490f4..5f1cc46a3 100644 --- a/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts +++ b/packages/jbrowse-plugin-apollo/cypress/e2e/editFeature.cy.ts @@ -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) @@ -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) @@ -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) diff --git a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts index f1c5581d4..765ddc14b 100644 --- a/packages/jbrowse-plugin-apollo/cypress/support/commands.ts +++ b/packages/jbrowse-plugin-apollo/cypress/support/commands.ts @@ -119,8 +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() + // cy.get('button[aria-label="Close drawer"]', { timeout: 20_000 }).click() + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(1000) cy.reload() + // 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 }) })