diff --git a/plugins/index.js b/plugins/index.js index 6507a48c0..29f89de05 100644 --- a/plugins/index.js +++ b/plugins/index.js @@ -6,10 +6,18 @@ module.exports = (on, config) => { } else if (extension === 'keplr') { selectedConfig = require('./keplr-plugin'); } else { - throw new Error( - `${extension} is not a valid extension name`, + throw new Error(`${extension} is not a valid extension name`); + } + + if (process.env.SKIP_EXTENSION_SETUP) { + config.env.SKIP_EXTENSION_SETUP = JSON.parse( + process.env.SKIP_EXTENSION_SETUP, ); } + if (process.env.EXTENSION) { + config.env.EXTENSION = process.env.EXTENSION; + } + return selectedConfig(on, config); }; diff --git a/support/index.js b/support/index.js index 8bb05ed2c..92911f960 100644 --- a/support/index.js +++ b/support/index.js @@ -25,7 +25,14 @@ Cypress.on('window:before:load', win => { }); before(() => { - if (Cypress.env('EXTENSION') === 'metamask' && !Cypress.env('SKIP_EXTENSION_SETUP')) { - cy.setupMetamask(); + if (!Cypress.env('SKIP_EXTENSION_SETUP')) { + switch (Cypress.env('EXTENSION')) { + case 'metamask': + cy.setupMetamask(); + break; + case 'keplr': + cy.setupWallet(); + break; + } } });