-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cypress' of https://github.com/GMOD/Apollo3 into cypress
- Loading branch information
Showing
5 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
packages/jbrowse-plugin-apollo/cypress/e2e/add_assembly.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
describe('Add Assembly', () => { | ||
beforeEach(() => { | ||
cy.fixture('tmp.json').then((config) => { | ||
cy.exec( | ||
`mongosh ${config.MONGODB_URI} --eval 'db.assemblies.deleteOne({name: "volvox_deleteme"})'`, | ||
).then((result) => { | ||
cy.log(result.stdout) | ||
cy.log(result.stderr) | ||
}) | ||
}) | ||
cy.loginAsGuest('config.tmp.json') | ||
}) | ||
|
||
it('Can add assembly from fasta', () => { | ||
cy.contains('Apollo').click() | ||
cy.contains('Add Assembly').click() | ||
cy.get('input[type="TextField"]').type('volvox_deleteme') | ||
cy.get('input[value="text/x-fasta"]').check() | ||
cy.get('input[type="file"]').selectFile('test_data/volvox.fa') | ||
|
||
cy.intercept('/changes').as('changes') | ||
cy.contains('Submit').click() | ||
cy.contains('is being added', { timeout: 10000 }) | ||
cy.wait('@changes').its('response.statusCode').should('match', /2../) | ||
}) | ||
|
||
it('Can add assembly from 2bit', () => { | ||
cy.contains('Apollo').click() | ||
cy.contains('Add Assembly').click() | ||
cy.get('input[type="TextField"]').type('volvox_deleteme') | ||
cy.get('input[value="text/x-fasta"]').check() | ||
cy.get('input[type="file"]').selectFile('test_data/volvox.2bit') | ||
|
||
cy.intercept('/changes').as('changes') | ||
cy.contains('Submit').click() | ||
cy.contains('is being added', { timeout: 10000 }) | ||
cy.wait('@changes').its('response.statusCode').should('match', /2../) | ||
}) | ||
|
||
it('Can add assembly from gff3 with fasta', () => { | ||
cy.contains('Apollo').click() | ||
cy.contains('Add Assembly').click() | ||
cy.get('input[type="TextField"]').type('volvox_deleteme') | ||
cy.get('input[value="text/x-gff3"]').check() | ||
cy.get('input[type="file"]').selectFile('test_data/volvox.fasta.gff3') | ||
|
||
cy.intercept('/changes').as('changes') | ||
cy.contains('Submit').click() | ||
cy.contains('is being added', { timeout: 10000 }) | ||
cy.wait('@changes').its('response.statusCode').should('match', /2../) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/jbrowse-plugin-apollo/cypress/e2e/open_assembly.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('Open Assembly', () => { | ||
it('Can open assembly', () => { | ||
cy.loginAsGuest('config.tmp.json') | ||
cy.contains('Select assembly to view', { timeout: 10000 }) | ||
cy.get('input[data-testid="assembly-selector"]').parent().click() | ||
cy.contains('volvox_cy').click() | ||
cy.contains('Open').click() | ||
// It would be better to test that the screen contains "volvox_cy" somewhere (at the moment it doesn't) | ||
cy.get('input[placeholder="Search for location"][value="ctgA:1..50,001"]') | ||
}) | ||
}) |
50 changes: 50 additions & 0 deletions
50
packages/jbrowse-plugin-apollo/cypress/e2e/search_features.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe('Search features', () => { | ||
beforeEach(() => { | ||
cy.fixture('config.tmp.json').then((config) => { | ||
cy.exec( | ||
`mongosh ${config.MONGODB_URI} --eval 'db.assemblies.deleteMany({})'`, | ||
).then((result) => { | ||
cy.log(result.stdout) | ||
cy.log(result.stderr) | ||
}) | ||
}) | ||
cy.loginAsGuest('config.tmp.json') | ||
}) | ||
|
||
it('One hit, no children', () => { | ||
cy.addAssemblyFromGff('volvox_cy', 'test_data/volvox.fasta.gff3') | ||
cy.selectAssemblyToView('volvox_cy') | ||
cy.searchFeatures('Match6') | ||
cy.currentLocationEquals('ctgA', 8000, 9000, 10) | ||
}) | ||
|
||
it('One matching Parent and multiple matching children', () => { | ||
cy.addAssemblyFromGff('volvox_cy', 'test_data/volvox.fasta.gff3') | ||
cy.selectAssemblyToView('volvox_cy') | ||
cy.searchFeatures('EDEN') | ||
cy.currentLocationEquals('ctgA', 1050, 9000, 10) | ||
}) | ||
|
||
it.only('Can handle space in attribute values', () => { | ||
cy.addAssemblyFromGff('volvox_cy', 'test_data/space.gff3') | ||
cy.selectAssemblyToView('volvox_cy') | ||
cy.searchFeatures('.1') | ||
cy.contains('Error: Unknown reference sequence "SpamGene"') | ||
}) | ||
|
||
it('Search only the selected assembly', () => { | ||
cy.addAssemblyFromGff('volvox_cy', 'test_data/volvox.fasta.gff3') | ||
cy.addAssemblyFromGff('volvox_spam', 'test_data/volvox2.fasta.gff3') | ||
|
||
cy.selectAssemblyToView('volvox_spam') | ||
cy.searchFeatures('SpamGene') | ||
cy.currentLocationEquals('ctgA', 100, 200, 10) | ||
|
||
cy.fixture('config.tmp.json').then((config) => { | ||
cy.visit(config.apollo_url) | ||
}) | ||
cy.selectAssemblyToView('volvox_cy') | ||
cy.searchFeatures('SpamGene') | ||
cy.contains('Error: Unknown reference sequence "SpamGene"') | ||
}) | ||
}) |
4 changes: 4 additions & 0 deletions
4
packages/jbrowse-plugin-apollo/cypress/fixtures/config.tmp.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"apollo_url": "http://localhost:3000/?config=http%3A%2F%2Flocalhost%3A9000%2Fjbrowse_config.json" , | ||
"MONGODB_URI": "mongodb://localhost:27017/apolloTestDb" | ||
} |