mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Remove _behaviors abstraction in Chromium reporting (#20106)
* remove over abstraction. * delete unused file
This commit is contained in:
parent
575bc35f36
commit
db1aad03bb
4 changed files with 15 additions and 32 deletions
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export class IgnoreSSLErrorsBehavior {
|
||||
constructor(client) {
|
||||
this._client = client;
|
||||
}
|
||||
|
||||
async initialize() {
|
||||
const { Security } = this._client;
|
||||
await Security.enable();
|
||||
await Security.setOverrideCertificateErrors({ override: true });
|
||||
Security.certificateError(({ eventId }) => {
|
||||
Security.handleCertificateError({ eventId, action: 'continue' });
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export { IgnoreSSLErrorsBehavior } from './ignore_ssl_errors';
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export async function ignoreSSLErrorsBehavior(Security) {
|
||||
await Security.enable();
|
||||
await Security.setOverrideCertificateErrors({ override: true });
|
||||
Security.certificateError(({ eventId }) => {
|
||||
Security.handleCertificateError({ eventId, action: 'continue' });
|
||||
});
|
||||
}
|
|
@ -9,7 +9,7 @@ import path from 'path';
|
|||
import moment from 'moment';
|
||||
import { promisify, delay } from 'bluebird';
|
||||
import { transformFn } from './transform_fn';
|
||||
import { IgnoreSSLErrorsBehavior } from './behaviors';
|
||||
import { ignoreSSLErrorsBehavior } from './ignore_ssl_errors';
|
||||
import { screenshotStitcher } from './screenshot_stitcher';
|
||||
|
||||
export class HeadlessChromiumDriver {
|
||||
|
@ -19,9 +19,6 @@ export class HeadlessChromiumDriver {
|
|||
this._waitForDelayMs = 100;
|
||||
this._zoom = 1;
|
||||
this._logger = logger;
|
||||
this._behaviors = [
|
||||
new IgnoreSSLErrorsBehavior(client),
|
||||
];
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
|
@ -46,7 +43,7 @@ export class HeadlessChromiumDriver {
|
|||
Page.enable(),
|
||||
]);
|
||||
|
||||
await Promise.all(this._behaviors.map(behavior => behavior.initialize()));
|
||||
await ignoreSSLErrorsBehavior(this._client.Security);
|
||||
await Network.setExtraHTTPHeaders({ headers });
|
||||
await Page.navigate({ url });
|
||||
await Page.loadEventFired();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue