-
-
Save rahulmr/3e99800a5c353e4cb0a81468e804a195 to your computer and use it in GitHub Desktop.
ChromeDriver on Travis CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
os: osx | |
node_js: '7' | |
sudo: required | |
env: HOMEBREW_CASK_OPTS='--appdir=/Applications' | |
before_install: | |
- brew update > /dev/null | |
- brew cask install google-chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"chromedriver": "^2.27.3", | |
"selenium-webdriver": "^3.1.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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