diff --git a/.travis.yml b/.travis.yml index d86757a..eb8da0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ addons: packages: # for Cypress - libgconf-2-4 - chrome: stable env: global: diff --git a/cypress/integration/consume.spec.js b/cypress/integration/consume.spec.js index a66a364..a937a4e 100644 --- a/cypress/integration/consume.spec.js +++ b/cypress/integration/consume.spec.js @@ -1,18 +1,6 @@ /// -import Web3 from 'web3' -import HDWalletProvider from 'truffle-hdwallet-provider' - context('Consume', () => { before(() => { - cy.on('window:before:load', win => { - const provider = new HDWalletProvider( - Cypress.env('SEEDPHRASE'), - Cypress.env('NODE_URI') - ) - win.web3 = new Web3(provider) - win.ethereum = win.web3 - }) - cy.visit(Cypress.env('CONSUME_ASSET')) // Wait for end of loading diff --git a/cypress/integration/faucet.spec.js b/cypress/integration/faucet.spec.js index d089467..3a93c48 100644 --- a/cypress/integration/faucet.spec.js +++ b/cypress/integration/faucet.spec.js @@ -1,18 +1,6 @@ /// -import Web3 from 'web3' -import HDWalletProvider from 'truffle-hdwallet-provider' - context('Faucet', () => { before(() => { - cy.on('window:before:load', win => { - const provider = new HDWalletProvider( - Cypress.env('SEEDPHRASE'), - Cypress.env('NODE_URI') - ) - win.web3 = new Web3(provider) - win.ethereum = win.web3 - }) - cy.visit('/faucet') // Wait for end of loading cy.get('button', { timeout: 60000 }).should('have.length', 1) diff --git a/cypress/integration/publish.spec.js b/cypress/integration/publish.spec.js index 36e20ab..1f34a12 100644 --- a/cypress/integration/publish.spec.js +++ b/cypress/integration/publish.spec.js @@ -1,18 +1,6 @@ /// -import Web3 from 'web3' -import HDWalletProvider from 'truffle-hdwallet-provider' - context('Publish', () => { before(() => { - cy.on('window:before:load', win => { - const provider = new HDWalletProvider( - Cypress.env('SEEDPHRASE'), - Cypress.env('NODE_URI') - ) - win.web3 = new Web3(provider) - win.ethereum = win.web3 - }) - cy.visit('/publish') cy.get('article>div', { timeout: 60000 }).should( diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js index 5f0d9dd..577b9db 100644 --- a/cypress/integration/search.spec.js +++ b/cypress/integration/search.spec.js @@ -1,18 +1,6 @@ /// -import Web3 from 'web3' -import HDWalletProvider from 'truffle-hdwallet-provider' - context('Search', () => { before(() => { - cy.on('window:before:load', win => { - const provider = new HDWalletProvider( - Cypress.env('SEEDPHRASE'), - Cypress.env('NODE_URI') - ) - win.web3 = new Web3(provider) - win.ethereum = win.web3 - }) - cy.visit('/') // Wait for end of loading cy.get('button', { timeout: 60000 }).should('have.length', 1) diff --git a/cypress/support/index.js b/cypress/support/index.js index e69de29..8797b20 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -0,0 +1,14 @@ +/// +import Web3 from 'web3' +import HDWalletProvider from 'truffle-hdwallet-provider' + +before(function() { + cy.on('window:before:load', win => { + const provider = new HDWalletProvider( + Cypress.env('SEEDPHRASE'), + Cypress.env('NODE_URI') + ) + win.web3 = new Web3(provider) + win.ethereum = win.web3 + }) +}) diff --git a/package.json b/package.json index e4b1e3b..4369114 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "lint": "npm run lint:js && npm run lint:css", "release": "release-it --non-interactive", "changelog": "auto-changelog -p", - "cypress:run": "cypress run --browser chrome", + "cypress:run": "cypress run", "cypress:open": "cypress open" }, "dependencies": {