1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

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
cypress/screenshots cypress/screenshots
cypress/videos cypress/videos
cypress/fixtures/did.txt

View File

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

View File

@ -64,5 +64,16 @@ context('Publish', () => {
cy.contains('Your asset is published!', { cy.contains('Your asset is published!', {
timeout: 12000 timeout: 12000
}).should('be.visible') }).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" /> /// <reference types="Cypress" />
context('Consume', () => { context('Consume', () => {
before(() => { 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 // Alias button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 }) cy.get('button[name="Download"]', { timeout: 60000 })