chore: make it possible to override Locator.dragTo(strict) (#11457)

This commit is contained in:
Max Schmitt 2022-01-18 17:51:15 +01:00 committed by GitHub
parent 5a9ff783be
commit b79daec8e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -81,8 +81,8 @@ export class Locator implements api.Locator {
async dragTo(target: Locator, options: channels.FrameDragAndDropOptions = {}) { async dragTo(target: Locator, options: channels.FrameDragAndDropOptions = {}) {
return this._frame.dragAndDrop(this._selector, target._selector, { return this._frame.dragAndDrop(this._selector, target._selector, {
...options,
strict: true, strict: true,
...options,
}); });
} }

View file

@ -38,17 +38,17 @@ export class Tracing implements api.Tracing {
} }
async stopChunk(options: { path?: string } = {}) { async stopChunk(options: { path?: string } = {}) {
await this._doStopChunk(this._context._channel, options.path); await this._doStopChunk(options.path);
} }
async stop(options: { path?: string } = {}) { async stop(options: { path?: string } = {}) {
await this._context._wrapApiCall(async () => { await this._context._wrapApiCall(async () => {
await this._doStopChunk(this._context._channel, options.path); await this._doStopChunk(options.path);
await this._context._channel.tracingStop(); await this._context._channel.tracingStop();
}); });
} }
private async _doStopChunk(channel: channels.BrowserContextChannel, filePath: string | undefined) { private async _doStopChunk(filePath: string | undefined) {
const isLocal = !this._context._connection.isRemote(); const isLocal = !this._context._connection.isRemote();
let mode: channels.BrowserContextTracingStopChunkParams['mode'] = 'doNotSave'; let mode: channels.BrowserContextTracingStopChunkParams['mode'] = 'doNotSave';
@ -59,7 +59,7 @@ export class Tracing implements api.Tracing {
mode = 'compressTrace'; mode = 'compressTrace';
} }
const result = await channel.tracingStopChunk({ mode }); const result = await this._context._channel.tracingStopChunk({ mode });
if (!filePath) { if (!filePath) {
// Not interested in artifacts. // Not interested in artifacts.
return; return;