fix(inspector): do not collect action signals while on pause (#5843)
This commit is contained in:
parent
36a61c36b3
commit
d81ebff414
|
|
@ -374,6 +374,9 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
progress.log(` element does receive pointer events`);
|
progress.log(` element does receive pointer events`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progress.metadata.point = point;
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
|
|
||||||
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
if ((options as any).__testHookBeforePointerAction)
|
if ((options as any).__testHookBeforePointerAction)
|
||||||
await (options as any).__testHookBeforePointerAction();
|
await (options as any).__testHookBeforePointerAction();
|
||||||
|
|
@ -382,8 +385,6 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
if (options && options.modifiers)
|
if (options && options.modifiers)
|
||||||
restoreModifiers = await this._page.keyboard._ensureModifiers(options.modifiers);
|
restoreModifiers = await this._page.keyboard._ensureModifiers(options.modifiers);
|
||||||
progress.log(` performing ${actionName} action`);
|
progress.log(` performing ${actionName} action`);
|
||||||
progress.metadata.point = point;
|
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
await action(point);
|
await action(point);
|
||||||
progress.log(` ${actionName} action done`);
|
progress.log(` ${actionName} action done`);
|
||||||
progress.log(' waiting for scheduled navigations to finish');
|
progress.log(' waiting for scheduled navigations to finish');
|
||||||
|
|
@ -455,10 +456,10 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
|
|
||||||
async _selectOption(progress: Progress, elements: ElementHandle[], values: types.SelectOption[], options: types.NavigatingActionWaitOptions): Promise<string[] | 'error:notconnected'> {
|
async _selectOption(progress: Progress, elements: ElementHandle[], values: types.SelectOption[], options: types.NavigatingActionWaitOptions): Promise<string[] | 'error:notconnected'> {
|
||||||
const optionsToSelect = [...elements, ...values];
|
const optionsToSelect = [...elements, ...values];
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
progress.throwIfAborted(); // Avoid action that has side-effects.
|
progress.throwIfAborted(); // Avoid action that has side-effects.
|
||||||
progress.log(' selecting specified option(s)');
|
progress.log(' selecting specified option(s)');
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
const poll = await this._evaluateHandleInUtility(([injected, node, optionsToSelect]) => {
|
const poll = await this._evaluateHandleInUtility(([injected, node, optionsToSelect]) => {
|
||||||
return injected.waitForElementStatesAndPerformAction(node, ['visible', 'enabled'], injected.selectOptions.bind(injected, optionsToSelect));
|
return injected.waitForElementStatesAndPerformAction(node, ['visible', 'enabled'], injected.selectOptions.bind(injected, optionsToSelect));
|
||||||
}, optionsToSelect);
|
}, optionsToSelect);
|
||||||
|
|
@ -479,6 +480,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
|
|
||||||
async _fill(progress: Progress, value: string, options: types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
async _fill(progress: Progress, value: string, options: types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
||||||
progress.log(`elementHandle.fill("${value}")`);
|
progress.log(`elementHandle.fill("${value}")`);
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
progress.log(' waiting for element to be visible, enabled and editable');
|
progress.log(' waiting for element to be visible, enabled and editable');
|
||||||
const poll = await this._evaluateHandleInUtility(([injected, node, value]) => {
|
const poll = await this._evaluateHandleInUtility(([injected, node, value]) => {
|
||||||
|
|
@ -490,7 +492,6 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
if (filled === 'error:notconnected')
|
if (filled === 'error:notconnected')
|
||||||
return filled;
|
return filled;
|
||||||
progress.log(' element is visible, enabled and editable');
|
progress.log(' element is visible, enabled and editable');
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
if (filled === 'needsinput') {
|
if (filled === 'needsinput') {
|
||||||
progress.throwIfAborted(); // Avoid action that has side-effects.
|
progress.throwIfAborted(); // Avoid action that has side-effects.
|
||||||
if (value)
|
if (value)
|
||||||
|
|
@ -535,9 +536,9 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
if (typeof multiple === 'string')
|
if (typeof multiple === 'string')
|
||||||
return multiple;
|
return multiple;
|
||||||
assert(multiple || files.length <= 1, 'Non-multiple file input can only accept single file!');
|
assert(multiple || files.length <= 1, 'Non-multiple file input can only accept single file!');
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
progress.throwIfAborted(); // Avoid action that has side-effects.
|
progress.throwIfAborted(); // Avoid action that has side-effects.
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
await this._page._delegate.setInputFiles(this as any as ElementHandle<HTMLInputElement>, files);
|
await this._page._delegate.setInputFiles(this as any as ElementHandle<HTMLInputElement>, files);
|
||||||
});
|
});
|
||||||
await this._page._doSlowMo();
|
await this._page._doSlowMo();
|
||||||
|
|
@ -569,12 +570,12 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
|
|
||||||
async _type(progress: Progress, text: string, options: { delay?: number } & types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
async _type(progress: Progress, text: string, options: { delay?: number } & types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
||||||
progress.log(`elementHandle.type("${text}")`);
|
progress.log(`elementHandle.type("${text}")`);
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
|
const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
|
||||||
if (result !== 'done')
|
if (result !== 'done')
|
||||||
return result;
|
return result;
|
||||||
progress.throwIfAborted(); // Avoid action that has side-effects.
|
progress.throwIfAborted(); // Avoid action that has side-effects.
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
await this._page.keyboard.type(text, options);
|
await this._page.keyboard.type(text, options);
|
||||||
return 'done';
|
return 'done';
|
||||||
}, 'input');
|
}, 'input');
|
||||||
|
|
@ -590,12 +591,12 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
|
||||||
|
|
||||||
async _press(progress: Progress, key: string, options: { delay?: number } & types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
async _press(progress: Progress, key: string, options: { delay?: number } & types.NavigatingActionWaitOptions): Promise<'error:notconnected' | 'done'> {
|
||||||
progress.log(`elementHandle.press("${key}")`);
|
progress.log(`elementHandle.press("${key}")`);
|
||||||
|
await progress.beforeInputAction(this);
|
||||||
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
return this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
|
||||||
const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
|
const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
|
||||||
if (result !== 'done')
|
if (result !== 'done')
|
||||||
return result;
|
return result;
|
||||||
progress.throwIfAborted(); // Avoid action that has side-effects.
|
progress.throwIfAborted(); // Avoid action that has side-effects.
|
||||||
await progress.beforeInputAction(this);
|
|
||||||
await this._page.keyboard.press(key, options);
|
await this._page.keyboard.press(key, options);
|
||||||
return 'done';
|
return 'done';
|
||||||
}, 'input');
|
}, 'input');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue