Skip to content

Instantly share code, notes, and snippets.

@rahulmr
Forked from chitoku-k/.travis.linux.yml
Created March 21, 2017 11:20
Show Gist options
  • Save rahulmr/3e99800a5c353e4cb0a81468e804a195 to your computer and use it in GitHub Desktop.
Save rahulmr/3e99800a5c353e4cb0a81468e804a195 to your computer and use it in GitHub Desktop.
ChromeDriver on Travis CI
os: linux
node_js: '7'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
before_script:
- sh -e /etc/init.d/xvfb start
os: osx
node_js: '7'
sudo: required
env: HOMEBREW_CASK_OPTS='--appdir=/Applications'
before_install:
- brew update > /dev/null
- brew cask install google-chrome
language: node_js
matrix:
include:
- os: linux
node_js: '7'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- os: osx
node_js: '7'
sudo: required
env: HOMEBREW_CASK_OPTS='--appdir=/Applications'
before_install:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew update > /dev/null
brew cask install google-chrome
fi
install:
- npm install
before_script:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sh -e /etc/init.d/xvfb start
fi
script:
- npm test
{
"devDependencies": {
"chromedriver": "^2.27.3",
"selenium-webdriver": "^3.1.0"
}
}
const webdriver = require("selenium-webdriver");
const chrome = require("selenium-webdriver/chrome");
const chromedriver = require("chromedriver");
const until = webdriver.until;
const By = webdriver.By;
const options = new chrome.Options();
options.addArguments("no-sandbox");
const builder = new webdriver.Builder();
builder.forBrowser("chrome");
builder.setChromeOptions(options);
const driver = builder.build();
(async () => {
await driver.get("https://tweetdeck.twitter.com");
await driver.wait(until.titleIs("TweetDeck"));
const login = await driver.findElement(By.css("form.form-login a.btn"));
await login.click();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment