Skip to content

Instantly share code, notes, and snippets.

@lwillmeth
Created June 11, 2019 22:36
Show Gist options
  • Save lwillmeth/8d7b6975eccdfcb0a5b314a45e71ac80 to your computer and use it in GitHub Desktop.
Save lwillmeth/8d7b6975eccdfcb0a5b314a45e71ac80 to your computer and use it in GitHub Desktop.
const path = require('path')
const chromeArgs = [
'--headless',
'--single-process',
'--disable-gpu',
'--disable-background-timer-throttling',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-cloud-import',
'--disable-default-apps',
'--disable-dev-shm-usage',
'--disable-extensions',
'--disable-gesture-typing',
'--disable-hang-monitor',
'--disable-infobars',
'--disable-notifications',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-offer-upload-credit-cards',
'--disable-popup-blocking',
'--disable-print-preview',
'--disable-prompt-on-repost',
'--disable-setuid-sandbox',
'--disable-speech-api',
'--disable-sync',
'--disable-tab-for-desktop-share',
'--disable-translate',
'--disable-voice-input',
'--disable-wake-on-wifi',
'--enable-async-dns',
'--enable-simple-cache-backend',
'--enable-tcp-fast-open',
'--enable-webgl',
'--hide-scrollbars',
'--ignore-gpu-blacklist',
'--media-cache-size=33554432',
'--metrics-recording-only',
'--mute-audio',
'--no-default-browser-check',
'--no-first-run',
'--no-pings',
'--no-sandbox',
'--no-zygote',
'--password-store=basic',
'--prerender-from-omnibox=disabled',
'--use-gl=swiftshader',
'--use-mock-keychain'
];
exports.config = {
/**
* server configurations
*/
port: '9515',
path: '/',
/**
* specify test files
*/
specs: ['example.spec.js'],
/**
* capabilities
*/
capabilities: [{
browserName: 'chromium',
chromeOptions: {
args: chromeArgs,
binary: '/tmp/browsers/chromium-latest'
}
}],
services: ['chromedriver'],
/**
* test configurations
*/
logLevel: 'verbose',
coloredLogs: true,
framework: 'mocha',
outputDir: __dirname,
reporters: ['dot'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
}
}
const expect = require('chai').expect;
describe('example tests', function () {
it('Google has a title', function () {
browser.url('https://google.com');
const title = browser.getTitle();
expect(title).to.exist;
expect(title).to.be.a('string');
});
});
/var/task/node_modules/lib-webdriverio-nodejs/lib/wdio
[17:24:20]  COMMAND POST "/session"
[17:24:20]  DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","chromeOptions":{"args":["--headless","--single-process","--disable-gpu","--disable-background-timer-throttling","--disable-breakpad","--disable-client-side-phishing-detection","--disable-cloud-import","--disable-default-apps","--disable-dev-shm-usage","--disable-extensions","(34 more items)"],"binary":"/tmp/browsers/chromium-latest"},"loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.14.4","name":"webdriverio"}}}
ERROR: ESOCKETTIMEDOUT
chrome
at new RuntimeError (/var/task/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:143:12)
at Request._callback (/var/task/node_modules/webdriverio/build/lib/utils/RequestHandler.js:342:43)
at self.callback (/var/task/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at ClientRequest.<anonymous> (/var/task/node_modules/request/request.js:819:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at Socket.emitTimeout (_http_client.js:679:34)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment