diff --git a/.gitignore b/.gitignore index 9366864..a2ec474 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ yarn-error.log* # cypress cypress/screenshots cypress/videos +cypress/fixtures/did.txt diff --git a/cypress.json b/cypress.json index dcd7dbb..17ef242 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,3 @@ { - "baseUrl": "http://localhost:3000", - "env": { - "CONSUME_ASSET": "did:op:3fa4721ad643489bad77e0e52ecefe9b73166873faaf4661a02486b735eea0c8" - } + "baseUrl": "http://localhost:3000" } diff --git a/cypress/integration/publish.spec.js b/cypress/integration/1_publish.spec.js similarity index 87% rename from cypress/integration/publish.spec.js rename to cypress/integration/1_publish.spec.js index 40be219..452e3d8 100644 --- a/cypress/integration/publish.spec.js +++ b/cypress/integration/1_publish.spec.js @@ -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/', '') + ) + }) }) }) diff --git a/cypress/integration/search.spec.js b/cypress/integration/2_search.spec.js similarity index 100% rename from cypress/integration/search.spec.js rename to cypress/integration/2_search.spec.js diff --git a/cypress/integration/consume.spec.js b/cypress/integration/3_consume.spec.js similarity index 91% rename from cypress/integration/consume.spec.js rename to cypress/integration/3_consume.spec.js index 95bd8b7..ddb1ef9 100644 --- a/cypress/integration/consume.spec.js +++ b/cypress/integration/3_consume.spec.js @@ -1,7 +1,9 @@ /// 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 }) diff --git a/cypress/integration/faucet.spec.js b/cypress/integration/4_faucet.spec.js similarity index 100% rename from cypress/integration/faucet.spec.js rename to cypress/integration/4_faucet.spec.js