How to use geckodriver - 10 common examples

To help you get started, we’ve selected a few geckodriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / test / functional / services / remote / webdriver.ts View on Github external
const firefoxOptions = new firefox.Options();
        // Firefox 65+ supports logging console output to stdout
        firefoxOptions.set('moz:firefoxOptions', {
          prefs: { 'devtools.console.stdout.content': true },
        });
        if (headlessBrowser === '1') {
          // See: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode
          firefoxOptions.headless();
        }

        // Windows issue with stout socket https://github.com/elastic/kibana/issues/52053
        if (process.platform === 'win32') {
          const session = await new Builder()
            .forBrowser(browserType)
            .setFirefoxOptions(firefoxOptions)
            .setFirefoxService(new firefox.ServiceBuilder(geckoDriver.path))
            .build();
          return {
            session,
            consoleLog$: Rx.EMPTY,
          };
        }

        const { input, chunk$, cleanup } = await createStdoutSocket();
        lifecycle.on('cleanup', cleanup);

        const session = await new Builder()
          .forBrowser(browserType)
          .setFirefoxOptions(firefoxOptions)
          .setFirefoxService(
            new firefox.ServiceBuilder(geckoDriver.path).setStdio(['ignore', input, 'ignore'])
          )
github vuejs / vue-router / test / e2e / nightwatch.config.js View on Github external
module.exports = {
  src_folders: ['test/e2e/specs'],
  output_folder: 'test/e2e/reports',
  custom_commands_path: ['node_modules/nightwatch-helpers/commands'],
  custom_assertions_path: ['node_modules/nightwatch-helpers/assertions'],
  // set to true when testing on multiple browsers (-e chrome,firefox) to display tests as they pass instead of waiting for everything to be finished
  live_output: false,

  selenium: {
    start_process: true,
    server_path: require('selenium-server').path,
    host: '127.0.0.1',
    port: 4444,
    cli_args: {
      'webdriver.chrome.driver': require('chromedriver').path,
      'webdriver.gecko.driver': require('geckodriver').path
    }
  },

  test_settings: {
    default: {
      selenium_port: 4444,
      selenium_host: 'localhost',
      silent: true,
      screenshots: {
        enabled: true,
        on_failure: true,
        on_error: false,
        path: 'test/e2e/screenshots'
      },
      desiredCapabilities: {
        browserName: 'chrome',
github phiphou / webpack-vue-demo / config / nightwatch / nightwatch.js View on Github external
src_folders: [`${projectRoot}/test/e2e/`],
  output_folder: `${projectRoot}/reports/e2e/${utils.reportsDir}/`,
  custom_commands_path: '',
  custom_assrtions_path: '',
  page_objects_path: 'test/e2e/pages',
  globals_path: 'config/nightwatch/globals.js',
  selenium: {
    start_process: false,
    server_path: './node_modules/selenium-standalone/.selenium/selenium-server/2.53.1-server.jar',
    log_path: `${projectRoot}/reports/e2e/`,
    host: '127.0.0.1',
    port: 4444,
    silent: true,
    cli_args: {
      'webdriver.chrome.driver': require('chromedriver').path,
      'webdriver.gecko.driver': require('geckodriver').path
    }
  },
  // 'test_workers': {'enabled': true, 'workers': 'auto'},
  test_settings: {
    default: {
      launch_url: 'http://localhost',
      selenium_port: process.env.CIRCLE_ENV ? 80 : 4444,
      selenium_host: process.env.CIRCLE_ENV ? 'ondemand.saucelabs.com' : 'localhost',
      silent: true,
      screenshots: {
        enabled: true,
        path: projectRoot + `/reports/e2e/${utils.reportsDir}/screenshots`,
        on_failure: true,
        on_error: true
      },
      globals: {
github sneakypete81 / updatescanner / scripts / test-func.js View on Github external
const test = async function() {
  console.log('Starting Geckodriver...');
  geckodriver.start();

  console.log('Running functional tests...');

  try {
    childProcess.execFileSync(
      'poetry', ['run', 'pytest'],
      {cwd: FUNC_TEST_PATH, stdio: 'inherit'},
    );
  } finally {
    console.log('Stopping Geckodriver...');
    geckodriver.stop();
  }
};
github sneakypete81 / updatescanner / scripts / test-func.js View on Github external
const test = async function() {
  console.log('Starting Geckodriver...');
  geckodriver.start();

  console.log('Running functional tests...');

  try {
    childProcess.execFileSync(
      'poetry', ['run', 'pytest'],
      {cwd: FUNC_TEST_PATH, stdio: 'inherit'},
    );
  } finally {
    console.log('Stopping Geckodriver...');
    geckodriver.stop();
  }
};
github mucsi96 / nightwatch-api / packages / nightwatch-api / e2e-test-env / nightwatch.conf.js View on Github external
},
    chrome: {
      webdriver: {
        server_path: chromedriver.path,
        cli_args: ['--port=4444']
      },
      desiredCapabilities: {
        browserName: 'chrome',
        'goog:chromeOptions': {
          w3c: false
        }
      }
    },
    firefox: {
      webdriver: {
        server_path: geckodriver.path,
        cli_args: ['--port', '4444', '--log', 'debug']
      },
      desiredCapabilities: {
        browserName: 'firefox',
        marionette: true
      }
    }
  }
};
github pressbooks / pressbooks / e2e_tests / config / nightwatch.conf.js View on Github external
server_path: require('chromedriver').path,
				log_path: './e2e_tests/log'
			}
		},
		firefox: {
			desiredCapabilities : {
				browserName : 'firefox',
				acceptInsecureCerts: true,
				acceptSslCerts : true,
				ignoreProtectedModeSettings: true,
				unexpectedAlertBehaviour: 'accept'
			},
			webdriver: {
				start_process: true,
				port: 4444,
				server_path: require('geckodriver').path,
				log_path: './e2e_tests/log'
			}
		}
	}
};
github mobxjs / mobx-devtools / test / prepare.js View on Github external
const startBrowser = () => {
  switch (TARGET_BROWSER) {
    case 'chrome':
      chromedriver.start();
      return () => chromedriver.stop();
    case 'firefox':
      geckodriver.start();
      return () => geckodriver.stop();
    default:
      throw new Error(`${TARGET_BROWSER} browser driver is not configured`);
  }
};
github mobxjs / mobx-devtools / test / prepare.js View on Github external
      return () => geckodriver.stop();
    default:
github mucsi96 / nightwatch-api / packages / cucumber-example / nightwatch.conf.js View on Github external
webdriver: {
        server_path: chromedriver.path,
        cli_args: ['--port=4444']
      },
      desiredCapabilities: {
        browserName: 'chrome',
        javascriptEnabled: true,
        acceptSslCerts: true,
        chromeOptions: {
          args: ['disable-gpu']
        }
      }
    },
    firefox: {
      webdriver: {
        server_path: geckodriver.path,
        cli_args: ['--port', '4444', '--log', 'debug']
      },
      desiredCapabilities: {
        browserName: 'firefox',
        javascriptEnabled: true,
        acceptSslCerts: true,
        marionette: true
      }
    }
  }
};

geckodriver

Mozilla's Geckodriver for Node.js

MPL-2.0
Latest version published 2 months ago

Package Health Score

71 / 100
Full package analysis