From f29de7ce1a96b02b3874bfec60cd404479581879 Mon Sep 17 00:00:00 2001 From: liza-mae Date: Wed, 26 Feb 2020 10:26:11 -0700 Subject: [PATCH] Add a way to disable certificate verification for FTR. (#58386) (#58522) * Add a way to disable certificate verification for FTR. * Remove other options Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- test/functional/services/remote/webdriver.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index 01574d550765..eaed82940679 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -45,6 +45,8 @@ import { Browsers } from './browsers'; const throttleOption: string = process.env.TEST_THROTTLE_NETWORK as string; const headlessBrowser: string = process.env.TEST_BROWSER_HEADLESS as string; +const remoteDebug: string = process.env.TEST_REMOTE_DEBUG as string; +const certValidation: string = process.env.NODE_TLS_REJECT_UNAUTHORIZED as string; const SECOND = 1000; const MINUTE = 60 * SECOND; const NO_QUEUE_COMMANDS = ['getLog', 'getStatus', 'newSession', 'quit']; @@ -99,6 +101,13 @@ async function attemptToCreateCommand( // See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md chromeOptions.push('headless', 'disable-gpu'); } + if (certValidation === '0') { + chromeOptions.push('ignore-certificate-errors'); + } + if (remoteDebug === '1') { + // Visit chrome://inspect in chrome to remotely view/debug + chromeOptions.push('headless', 'disable-gpu', 'remote-debugging-port=9222'); + } chromeCapabilities.set('goog:chromeOptions', { w3c: false, args: chromeOptions,