run cypress tests in specific order, store and read published DID

This commit is contained in:
Matthias Kretschmann 2019-07-19 16:38:29 +02:00
parent abe3f9630f
commit c2e2606133
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 16 additions and 5 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ yarn-error.log*
# cypress
cypress/screenshots
cypress/videos
cypress/fixtures/did.txt

View File

@ -1,6 +1,3 @@
{
"baseUrl": "http://localhost:3000",
"env": {
"CONSUME_ASSET": "did:op:3fa4721ad643489bad77e0e52ecefe9b73166873faaf4661a02486b735eea0c8"
}
"baseUrl": "http://localhost:3000"
}

View File

@ -64,5 +64,16 @@ context('Publish', () => {
cy.contains('Your asset is published!', {
timeout: 12000
}).should('be.visible')
// Store DID
cy.get('a')
.contains('See published asset')
.invoke('attr', 'href')
.then(href => {
cy.writeFile(
'cypress/fixtures/did.txt',
href.replace('/asset/', '')
)
})
})
})

View File

@ -1,7 +1,9 @@
/// <reference types="Cypress" />
context('Consume', () => {
before(() => {
cy.visit(`/asset/${Cypress.env('CONSUME_ASSET')}`)
cy.fixture('did').then(did => {
cy.visit(`/asset/${did}`)
})
// Alias button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 })