|
| 1 | +/* eslint-disable cypress/no-unnecessary-waiting */ |
| 2 | +describe('Simple tests for visuals', () => { |
| 3 | + beforeEach(() => { |
| 4 | + cy.loginAsGuest() |
| 5 | + }) |
| 6 | + afterEach(() => { |
| 7 | + cy.deleteAssemblies() |
| 8 | + }) |
| 9 | + it('Shows correct gene model', () => { |
| 10 | + cy.addAssemblyFromGff('so_types.gff3', 'test_data/so_types.gff3') |
| 11 | + cy.selectAssemblyToView('so_types.gff3') |
| 12 | + cy.get('body').then(($body) => { |
| 13 | + if ($body.find('button[aria-label="Close drawer"]').length > 0) { |
| 14 | + cy.get('button[aria-label="Close drawer"]').click() |
| 15 | + } |
| 16 | + }) |
| 17 | + |
| 18 | + cy.searchFeatures('TGGT1_200010', 1) |
| 19 | + cy.wait(2000) |
| 20 | + cy.get('canvas[data-testid="overlayCanvas"]').compareSnapshot('gene-model') |
| 21 | + }) |
| 22 | + it('Shows different glyph types', () => { |
| 23 | + cy.addAssemblyFromGff('glyph_types.gff3', 'test_data/glyph_types.gff3') |
| 24 | + cy.selectAssemblyToView('glyph_types.gff3') |
| 25 | + cy.contains('Open track selector').click() |
| 26 | + cy.contains('Reference sequence (').click() |
| 27 | + cy.contains('Annotations (').click() |
| 28 | + |
| 29 | + cy.get('body').then(($body) => { |
| 30 | + if ($body.find('button[aria-label="Close drawer"]').length > 0) { |
| 31 | + cy.get('button[aria-label="Close drawer"]').click() |
| 32 | + } |
| 33 | + }) |
| 34 | + cy.wait(2000) // Wait for render |
| 35 | + cy.get('canvas[data-testid="seqTrackCanvas"]').compareSnapshot( |
| 36 | + 'seq-track-canvas', |
| 37 | + ) |
| 38 | + |
| 39 | + cy.get('[data-testid="track_menu_icon"]').last().click() |
| 40 | + cy.contains('Display types').trigger('mouseover') |
| 41 | + cy.contains('LinearApolloSixFrameDisplay').click() |
| 42 | + cy.wait(2000) // Wait for render |
| 43 | + cy.get('canvas[data-testid="canvas"]').compareSnapshot( |
| 44 | + 'linear-apollo-six-frame-display-canvas', |
| 45 | + ) |
| 46 | + |
| 47 | + cy.get('[data-testid="track_menu_icon"]').last().click() |
| 48 | + cy.contains('Display types').trigger('mouseover') |
| 49 | + cy.contains('LinearApolloDisplay').click() |
| 50 | + cy.get('button[data-testid="view_menu_icon"]', { timeout: 10_000 }).click({ |
| 51 | + force: true, |
| 52 | + timeout: 10_000, |
| 53 | + }) |
| 54 | + cy.contains('Show...', { timeout: 10_000 }).click() |
| 55 | + cy.contains('Show all regions in assembly', { timeout: 10_000 }).click() |
| 56 | + cy.wait(2000) // Wait for render |
| 57 | + cy.get('canvas[data-testid="canvas"]').compareSnapshot( |
| 58 | + 'linear-apollo-display-canvas', |
| 59 | + ) |
| 60 | + }) |
| 61 | +}) |
0 commit comments