Skip to content

Commit

Permalink
[WNMGDS-231] Remove chromedriver temporary fix (#623)
Browse files Browse the repository at this point in the history
* Upgrade chromedriver to 80

* Upgrade selenium-webdriver and update chrome options

* Revert temporary e2e options

* Add version logging

* Remove unnecessary instance of chrome

* Fix css build error
  • Loading branch information
bernardwang authored Feb 18, 2020
1 parent f51485c commit 8378bf8
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 44 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
dist: trusty
addons:
chrome: stable
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
- export PATH="$HOME/.yarn/bin:$PATH"
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 --no-sandbox --disable-dev-shm-usage http://localhost &
- google-chrome-stable --version
- chromedriver --version
install:
- yarn
branches:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"browser-sync": "2.26.7",
"bytes": "3.1.0",
"chalk": "^2.4.2",
"chromedriver": "2.35.0",
"chromedriver": "80.0.1",
"cli-table": "^0.3.1",
"colors": "1.3.3",
"core-js": "^2.5.3",
Expand Down Expand Up @@ -87,7 +87,7 @@
"react-docgen": "4.1.1",
"react-dom": "16.8.6",
"react-test-renderer": "16.8.6",
"selenium-webdriver": "4.0.0-alpha.1",
"selenium-webdriver": "4.0.0-alpha.5",
"static-server": "^2.2.1",
"stylelint": "10.1.0",
"stylelint-config-prettier": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/base/typography/link.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* stylelint-disable selector-class-pattern */
@import '@cmsgov/design-system-support/src/settings/index';
@import '@cmsgov/design-system-support/src/index';

%link {
color: $color-primary;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/HelpDrawer/HelpDrawer.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '@cmsgov/design-system-support/src/settings/index';
@import '@cmsgov/design-system-support/src/index';

@keyframes slideInHelpDrawer {
from {
Expand Down
4 changes: 1 addition & 3 deletions tools/jest/e2e.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const headless = process.env.HEADLESS ? JSON.parse(process.env.HEADLESS) : true;
const browser = headless ? 'chrome' : process.env.BROWSER || 'chrome';
const chromeOptions = headless && {
args: ['--headless', '--window-size=1024,768', '--no-sandbox', '--disable-dev-shm-usage']
};
const chromeOptions = headless && ['--headless', '--window-size=1024,768'];

const validBrowsers = ['chrome', 'firefox', 'safari', 'ie', 'edge'];
if (!validBrowsers.includes(browser)) {
Expand Down
11 changes: 6 additions & 5 deletions tools/jest/e2e.environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable filenames/match-exported */
const NodeEnvironment = require('jest-environment-node');
const { Builder, By, Capabilities, Key, until } = require('selenium-webdriver');
const { Builder, By, Key, until } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');

class WebDriverEnvironment extends NodeEnvironment {
constructor(config) {
Expand All @@ -11,12 +12,12 @@ class WebDriverEnvironment extends NodeEnvironment {
}

async buildDriver() {
let driver = new Builder().forBrowser(this.browserName);
const driver = new Builder().forBrowser(this.browserName);

if (this.chromeOptions) {
const chromeCapabilities = Capabilities.chrome();
chromeCapabilities.set('chromeOptions', this.chromeOptions);
driver = driver.withCapabilities(chromeCapabilities);
const chromeOptions = new chrome.Options();
chromeOptions.addArguments(this.chromeOptions);
driver.setChromeOptions(chromeOptions);
}

return driver.build();
Expand Down
Loading

0 comments on commit 8378bf8

Please sign in to comment.