1

So we are trying to configure NightWatch so that the resulting opened firefox browser window, comes pre-installed with a extension (MetaMask) - so that tests can use Metamask to test out simple wallet transactions.

I'm fairly certain this is possible using geckodriver. Our current nightwatch.conf.js file is:

const pathToGeckoDriver = require('geckodriver').path;

module.exports = {
  src_folders: ['src/tests'],
  page_objects_path: ['src/pages'],
  custom_commands_path: ['src/custom-commands'],

  webdriver: {
    start_process: true,
    server_path: pathToGeckoDriver,
  },

  test_settings: {
    default: {
      launch_url: 'https://some-website.com',
      end_session_on_fail: false,
      desiredCapabilities: {
        browserName: 'firefox',
        acceptInsecureCerts: true,
        javascriptEnabled: true,
        firefoxOptions: {
          args: ['-profile', 'nightwatch'], // tried making a "nightwatch" profile for firefox and setting this profile at startup. no luck. :(
          add_extension: ['metamask-10.2.2-an+fx.xpi'], // tried various versions of this line, no luck. :(
        },
      },
    },
  },
};

We have downloaded the extension XPI file and placed it in the same dir as the nightwatch.conf.js file.

Has anyone managed to get geckodriver to boot with an extension installed via Nightwatch config?

glo
  • 687
  • 1
  • 8
  • 20

0 Answers0