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

Make SELENIUM_OVERRIDES available to override from base package.json #953

Closed
philippw opened this issue Jan 26, 2018 · 6 comments
Closed

Comments

@philippw
Copy link

I'm trying to convince wct-local to download selenium and its drivers via an internal Artifactory server instead of directly from GitHub. selenium-standalone supports this via its baseURL settings.

However, as selenium-standalone is a transitive dependency of wct-local I cannot override the default values.
Fortunately, there's the scripts/postinstall.js and its SELENIUM_OVERRIDES, which would allow for excatly that, would it not be the case that it only ever parses settings fromwct-local's ownpackage.json`.

Can we change the lookup path from ../package.json to ../../../package.json to be able to override the Selenium settings from the base package.json?

Bug migrated from the web-component-tester issues.

@bernardoVale
Copy link

That's exactly what I need!!!

@philippw
Copy link
Author

philippw commented Feb 6, 2018

Maybe we can even expose it as an environment variable?
Quoting @nicojs:

I think using an environment variable for this is more common for these types of features.

See this file: https://github.com/Polymer/wct-local/blob/master/scripts/postinstall.js

@bernardoVale
Copy link

@philippw you mean an env variable with package.json path?

@philippw
Copy link
Author

philippw commented Feb 6, 2018

@bernardoVale Yes and no. I'd like to be able to overwrite it with config values from your base package.json like this:

"selenium-overrides": {
    "version": "<version>",
    "baseURL": "URL-to-your-cache",
    "chrome": {
      "version": "<version>",
      "arch": "process.arch",
      "baseURL": "URL-to-your-cache"
    },
    "firefox": {
      "version": "<version>",
      "arch": "process.arch",
      "baseURL": "URL-to-your-cache"
    }
  }

If you just overwrite the SELENIUM_OVERRIDES, it'd have to be a relative path to your base config.

@bernardoVale
Copy link

bernardoVale commented Feb 6, 2018

@philippw take a look at my PR, I've tested locally and it works fine.

SELENIUM_OVERRIDES_CONFIG='../selenium-config.json' npm install

but it could be your package.json. It will look for a selenium-overrides object inside any json file provided in this env variable

To override with your local package.json it will be something like:

SELENIUM_OVERRIDES_CONFIG='../../../package.json' npm install

@aomarks aomarks transferred this issue from Polymer/wct-local Jan 3, 2019
@osamamaruf
Copy link

@aomarks This issue can be closed as PR #704 fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants