mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
f5856210d9
commit
97cf9c4a06
1 changed files with 3 additions and 10 deletions
|
@ -21,11 +21,6 @@ export class HeadlessChromiumDriver {
|
|||
this._logger = logger;
|
||||
}
|
||||
|
||||
async destroy() {
|
||||
this.killed = true;
|
||||
await this._client.close();
|
||||
}
|
||||
|
||||
async evaluate({ fn, args = [], awaitPromise = false, returnByValue = false }) {
|
||||
const { Runtime } = this._client;
|
||||
|
||||
|
@ -63,9 +58,7 @@ export class HeadlessChromiumDriver {
|
|||
|
||||
Page.screencastFrame(async ({ data, sessionId }) => {
|
||||
await this._writeData(path.join(recordPath, `${moment().utc().format('HH_mm_ss_SSS')}.png`), data);
|
||||
if (!this.killed) {
|
||||
await Page.screencastFrameAck({ sessionId });
|
||||
}
|
||||
await Page.screencastFrameAck({ sessionId });
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -123,13 +116,13 @@ export class HeadlessChromiumDriver {
|
|||
}
|
||||
|
||||
async waitFor({ fn, args, toEqual }) {
|
||||
while (!this.killed && (await this.evaluate({ fn, args })) !== toEqual) {
|
||||
while ((await this.evaluate({ fn, args })) !== toEqual) {
|
||||
await delay(this._waitForDelayMs);
|
||||
}
|
||||
}
|
||||
|
||||
async waitForSelector(selector) {
|
||||
while (!this.killed) {
|
||||
while (true) {
|
||||
const { nodeId } = await this._client.DOM.querySelector({ nodeId: this.documentNode.root.nodeId, selector });
|
||||
if (nodeId) {
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue