From 55af9ad5ab56a931da18761687c1d114f219d5c0 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 8 Jul 2019 16:29:21 +0200 Subject: [PATCH 1/5] run tests against Aquarius & Brizo pacific test instances --- .travis.yml | 4 ++-- client/.env.local.example | 26 ++++++++++++-------------- cypress.json | 2 +- cypress/integration/publish.spec.js | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index d48f64f..36ee89a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,8 @@ env: global: # run E2E tests against these values - REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" - - REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" - - REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" + - REACT_APP_AQUARIUS_URI="https://aquarius.test.oceanprotocol.com" + - REACT_APP_BRIZO_URI="https://brizo.test.oceanprotocol.com" - REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" - REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" - REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" diff --git a/client/.env.local.example b/client/.env.local.example index 29e6eba..791dfc3 100644 --- a/client/.env.local.example +++ b/client/.env.local.example @@ -7,21 +7,29 @@ # Connect to Pacific # REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" -REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" -REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" +# Pacific Test instances +REACT_APP_AQUARIUS_URI="https://aquarius.test.oceanprotocol.com" +REACT_APP_BRIZO_URI="https://brizo.test.oceanprotocol.com" +# Pacific Commons instances +# REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" +# REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" # # Connect to Nile # # REACT_APP_NODE_URI="https://nile.dev-ocean.com" -# REACT_APP_AQUARIUS_URI="https://aquarius.nile.dev-ocean.com" -# REACT_APP_BRIZO_URI="https://brizo.nile.dev-ocean.com" # REACT_APP_SECRET_STORE_URI="https://secret-store.nile.dev-ocean.com" # REACT_APP_FAUCET_URI="https://faucet.nile.dev-ocean.com" # REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" +# Nile Test instances +# REACT_APP_AQUARIUS_URI="https://aquarius.nile.dev-ocean.com" +# REACT_APP_BRIZO_URI="https://brizo.nile.dev-ocean.com" +# Nile Commons instances +# REACT_APP_AQUARIUS_URI="https://aquarius.marketplace.dev-ocean.com" +# REACT_APP_BRIZO_URI="https://brizo.marketplace.dev-ocean.com" # # Connect to Duero @@ -33,16 +41,6 @@ REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" # REACT_APP_FAUCET_URI="https://faucet.duero.dev-ocean.com" # REACT_APP_BRIZO_ADDRESS="0x9d4ed58293f71122ad6a733c1603927a150735d0" -# -# Connect to Nile Commons instances -# -# REACT_APP_NODE_URI="https://nile.dev-ocean.com" -# REACT_APP_AQUARIUS_URI="https://aquarius.marketplace.dev-ocean.com" -# REACT_APP_BRIZO_URI="https://brizo.marketplace.dev-ocean.com" -# REACT_APP_SECRET_STORE_URI="https://secret-store.dev-ocean.com" -# REACT_APP_FAUCET_URI="https://faucet.nile.dev-ocean.com" -# REACT_APP_BRIZO_ADDRESS="0x4aaab179035dc57b35e2ce066919048686f82972" - # # Connect to Spree (local with Barge) # diff --git a/cypress.json b/cypress.json index 52b427a..55adc96 100644 --- a/cypress.json +++ b/cypress.json @@ -3,6 +3,6 @@ "env": { "NODE_URI": "https://pacific.oceanprotocol.com", "SEEDPHRASE": "taxi music thumb unique chat sand crew more leg another off lamp", - "CONSUME_ASSET": "did:op:8f0086cf21e84389ad69b3272c56bd0ddc12cd7d98db4e02b4075c481fc2d32d" + "CONSUME_ASSET": "did:op:75c8808fa65e4c68b73568fdb36bd2b3d8076a43205543a3ac0235ca82aeef11" } } diff --git a/cypress/integration/publish.spec.js b/cypress/integration/publish.spec.js index 1f34a12..40be219 100644 --- a/cypress/integration/publish.spec.js +++ b/cypress/integration/publish.spec.js @@ -11,7 +11,7 @@ context('Publish', () => { it('Publish flow', () => { // Fill title - cy.get('input#name').type('Title test') + cy.get('input#name').type('Commons Integration Test') // Open Add a file form cy.get('button') .contains('+ Add a file') From c72ebd67492efd13df292c01ce5c885f25606f14 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 11 Jul 2019 15:46:58 +0200 Subject: [PATCH 2/5] switch Brizo address --- .travis.yml | 2 +- client/.env.local.example | 3 ++- cypress.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36ee89a..8d1e46e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - REACT_APP_BRIZO_URI="https://brizo.test.oceanprotocol.com" - REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" - REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" - - REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" + - REACT_APP_BRIZO_ADDRESS="0x0474ed05ba757dde575dfaaaa267d9e7f3643abc" before_install: - npm install -g npm diff --git a/client/.env.local.example b/client/.env.local.example index 791dfc3..0c1fc05 100644 --- a/client/.env.local.example +++ b/client/.env.local.example @@ -9,13 +9,14 @@ REACT_APP_NODE_URI="https://pacific.oceanprotocol.com" REACT_APP_SECRET_STORE_URI="https://secret-store.oceanprotocol.com" REACT_APP_FAUCET_URI="https://faucet.oceanprotocol.com" -REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" # Pacific Test instances REACT_APP_AQUARIUS_URI="https://aquarius.test.oceanprotocol.com" REACT_APP_BRIZO_URI="https://brizo.test.oceanprotocol.com" +REACT_APP_BRIZO_ADDRESS="0x0474ed05ba757dde575dfaaaa267d9e7f3643abc" # Pacific Commons instances # REACT_APP_AQUARIUS_URI="https://aquarius.commons.oceanprotocol.com" # REACT_APP_BRIZO_URI="https://brizo.commons.oceanprotocol.com" +# REACT_APP_BRIZO_ADDRESS="0x008c25ed3594e094db4592f4115d5fa74c4f41ea" # # Connect to Nile diff --git a/cypress.json b/cypress.json index 55adc96..72a50d4 100644 --- a/cypress.json +++ b/cypress.json @@ -3,6 +3,6 @@ "env": { "NODE_URI": "https://pacific.oceanprotocol.com", "SEEDPHRASE": "taxi music thumb unique chat sand crew more leg another off lamp", - "CONSUME_ASSET": "did:op:75c8808fa65e4c68b73568fdb36bd2b3d8076a43205543a3ac0235ca82aeef11" + "CONSUME_ASSET": "did:op:3fa4721ad643489bad77e0e52ecefe9b73166873faaf4661a02486b735eea0c8" } } From 93e6ba0af7f7c1fedc7e14755ebac94100c4f51e Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 11 Jul 2019 17:00:06 +0200 Subject: [PATCH 3/5] increase consume timeout --- cypress/integration/consume.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/consume.spec.js b/cypress/integration/consume.spec.js index 09be8cb..73c1424 100644 --- a/cypress/integration/consume.spec.js +++ b/cypress/integration/consume.spec.js @@ -23,7 +23,7 @@ context('Consume', () => { // Click consume button cy.get('@button').click() // Wait consume process to end - cy.get('@button', { timeout: 150000 }).should('contain', 'Get file') + cy.get('@button', { timeout: 600000 }).should('contain', 'Get file') // check if there is no error cy.get('article>div').should( 'not.contain', From 288c630aa8c13836344c3c53f66b993e2c66d4bc Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 12 Jul 2019 13:57:33 +0200 Subject: [PATCH 4/5] consume test fix --- cypress/integration/consume.spec.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cypress/integration/consume.spec.js b/cypress/integration/consume.spec.js index 73c1424..95bd8b7 100644 --- a/cypress/integration/consume.spec.js +++ b/cypress/integration/consume.spec.js @@ -9,21 +9,18 @@ context('Consume', () => { .should('have.length', 1) }) - beforeEach(() => { - cy.get('button[name="Download"]') - .first() - .as('button') - }) - it('Download button is clickable when user is connected.', () => { - cy.get('@button').should('not.be.disabled') + cy.get('button[name="Download"]').should('not.be.disabled') }) it('Consume asset and check if there is no error', () => { // Click consume button - cy.get('@button').click() + cy.get('button[name="Download"]').click() // Wait consume process to end - cy.get('@button', { timeout: 600000 }).should('contain', 'Get file') + cy.get('button[name="Download"]', { timeout: 600000 }).should( + 'contain', + 'Get file' + ) // check if there is no error cy.get('article>div').should( 'not.contain', From 9190dd6f2bf9e6dc96f24d5aee1a3367d15ca6cd Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Fri, 12 Jul 2019 14:06:09 +0200 Subject: [PATCH 5/5] run unit test coverage right after unit tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8d1e46e..cd2edf0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ script: # executing `npm test` scripts individually here, so first one failing will exit the build - npm run lint || travis_terminate 1 - ./scripts/test.sh || travis_terminate 1 - - npm run test:e2e || travis_terminate 1 - ./scripts/coverage.sh + - npm run test:e2e || travis_terminate 1 - ./scripts/build.sh notifications: