Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selenium server won't start from config file, unable to access jarfile #1

Open
ravi005e opened this issue Mar 17, 2022 · 0 comments
Open

Comments

@ravi005e
Copy link

ravi005e commented Mar 17, 2022

Error: Unable to access jarfile ./node_modules/@nightwatch/selenium-server/lib/selenium-server-4.1.2.jar standalone

here is config file

/* eslint-disable @typescript-eslint/naming-convention,@typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/typedef */
import { NightwatchOptions, NightwatchTestSettingScreenshots } from 'nightwatch';

const seleniumServer = require('@nightwatch/selenium-server');
const chromedriver = require('chromedriver');

require('ts-node').register({ transpileOnly: true });

const defaultTestSettings: NightwatchTestSettingScreenshots = {
  exclude: [],
  log_screenshot_data: false,
  end_session_on_fail: true,
  skip_testcases_on_fail: false,
  filter: '',
  silent: true,
  output: true,
  disable_colors: false,
  screenshots: {
    filename_format: () => '%I_%T',
    enabled: true,
    path: process.env.E2E_SCREENSHOTS_PATH ?? './screenshots',
    on_failure: true,
    on_error: true
  },
  desiredCapabilities: {
    loggingPrefs: { browser: 'ALL' },
    handlesAlerts: true,
    javascriptEnabled: true,
    acceptSslCerts: true
  }
};

const config: NightwatchOptions = {
  plugins: [],
  disable_typescript: false,
  skip_testcases_on_fail: false,
  src_folders: [
    'packages/test-source/dist/specs'
  ],
  output_folder: 'reports',
  page_objects_path: '',
  custom_commands_path: '',
  custom_assertions_path: '',
  globals_path: '',
  live_output: Boolean(process.env.LIVE_OUTPUT) || true,
  parallel_process_delay: 5000,

  test_workers: {
    enabled: true,
    workers: 'auto'
  },

  test_runner: {
    type: 'default',
    options: {
      ui: 'bdd'
    }
  },

  selenium: {
    start_process: true,
    start_session: false,
    server_path: seleniumServer.path,
    check_process_delay: 5,
    max_status_poll_tries: 5,
    status_poll_interval: 5,
    log_path: '',
    host: '127.0.0.1',
    port: 4444,
    cli_args: {
      'webdriver.chrome.driver': chromedriver.path
    }
  },

  // NightwatchTestSettings
  test_settings: {
    default: {
      ...defaultTestSettings,
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          args: ['window-size=1920,1280',
            '--disable-geolocation',
            '--disable-infobars',
            '--ignore-certificate-errors',
            '--disable-web-security',
            '--disable-gpu',
            '--headless',
            '--no-sandbox']
        }
      }
    }
  }
};

module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant