-
-
Save chitoku-k/67068aa62aa3f077f5307ca9a822ce74 to your computer and use it in GitHub Desktop.
os: linux | |
node_js: '12' | |
sudo: required | |
env: DISPLAY=':99.0' | |
dist: trusty | |
addons: | |
apt: | |
update: true | |
sources: | |
- google-chrome | |
packages: | |
- dpkg | |
- google-chrome-stable | |
before_script: | |
- sh -e /etc/init.d/xvfb start |
os: osx | |
node_js: '12' | |
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: '12' | |
sudo: required | |
env: DISPLAY=':99.0' | |
dist: trusty | |
addons: | |
apt: | |
update: true | |
sources: | |
- google-chrome | |
packages: | |
- dpkg | |
- google-chrome-stable | |
- os: osx | |
node_js: '12' | |
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": "^76.0.1", | |
"selenium-webdriver": "^4.0.0-alpha.5" | |
} | |
} |
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.manage().setTimeouts({ implicit: 30000 }); | |
await driver.get("https://tweetdeck.twitter.com"); | |
await driver.wait(until.titleIs("TweetDeck")); | |
const login = await driver.findElement(By.css("section.form-login a.Button")); | |
await login.click(); | |
})(); |
@richtr and @chitoku-k I ran into the same dpkg
error and can confirm that your fix works great. Thanks SO MUCH for posting this! I had been relying on Travis's dated version of Chrome plus the latest version of chromedriver and was running into incompatibility issues every few months. Seems like using apt with this fix gets my Chrome and chromedriver versions synced up and on an evergreen path now. Thanks again!
@richtr I appreciate your suggestions that pointed out how to fix that issue. Your fix successfully revived this config and I ascertained that the dpkg
is the root cause that prevented from this script working. And also thanks @dougjohnston for another successful reporting as well. The fix and the sample for TweetDeck has also been updated!
I've created the repository and integrate Travis CI build service for these gist
snippets.
Please feel free to use and refer :).
I received the following
dpkg
error on trying to installgoogle-chrome-stable
viaaddons
as shown above:Adding the following to the
.travis.linux.yml
file fixed it so it now works again (upgradedpkg
before installinggoogle-chrome-stable
):