fix(inspector): do not show internal calls (#10982)
Also mark setDefault{Navigation,}Timeout as always internal.
This commit is contained in:
parent
773ebe04c6
commit
dd57843404
|
|
@ -167,12 +167,16 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
|
||||||
|
|
||||||
setDefaultNavigationTimeout(timeout: number) {
|
setDefaultNavigationTimeout(timeout: number) {
|
||||||
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
||||||
this._channel.setDefaultNavigationTimeoutNoReply({ timeout });
|
this._wrapApiCall(async () => {
|
||||||
|
this._channel.setDefaultNavigationTimeoutNoReply({ timeout });
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaultTimeout(timeout: number) {
|
setDefaultTimeout(timeout: number) {
|
||||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||||
this._channel.setDefaultTimeoutNoReply({ timeout });
|
this._wrapApiCall(async () => {
|
||||||
|
this._channel.setDefaultTimeoutNoReply({ timeout });
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
browser(): Browser | null {
|
browser(): Browser | null {
|
||||||
|
|
|
||||||
|
|
@ -238,12 +238,16 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
|
||||||
|
|
||||||
setDefaultNavigationTimeout(timeout: number) {
|
setDefaultNavigationTimeout(timeout: number) {
|
||||||
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
||||||
this._channel.setDefaultNavigationTimeoutNoReply({ timeout });
|
this._wrapApiCall(async () => {
|
||||||
|
this._channel.setDefaultNavigationTimeoutNoReply({ timeout });
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaultTimeout(timeout: number) {
|
setDefaultTimeout(timeout: number) {
|
||||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||||
this._channel.setDefaultTimeoutNoReply({ timeout });
|
this._wrapApiCall(async () => {
|
||||||
|
this._channel.setDefaultTimeoutNoReply({ timeout });
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _forceVideo(): Video {
|
private _forceVideo(): Video {
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ export class RecorderSupplement implements InstrumentationListener {
|
||||||
return;
|
return;
|
||||||
const logs: CallLog[] = [];
|
const logs: CallLog[] = [];
|
||||||
for (const metadata of metadatas) {
|
for (const metadata of metadatas) {
|
||||||
if (!metadata.method)
|
if (!metadata.method || metadata.internal)
|
||||||
continue;
|
continue;
|
||||||
let status: CallLogStatus = 'done';
|
let status: CallLogStatus = 'done';
|
||||||
if (this._currentCallsMetadata.has(metadata))
|
if (this._currentCallsMetadata.has(metadata))
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,30 @@ it.describe('pause', () => {
|
||||||
await scriptPromise;
|
await scriptPromise;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should hide internal calls', async ({ page, recorderPageGetter, trace }) => {
|
||||||
|
it.skip(trace === 'on');
|
||||||
|
|
||||||
|
const scriptPromise = (async () => {
|
||||||
|
await page.pause();
|
||||||
|
await page.context().tracing.start();
|
||||||
|
page.setDefaultTimeout(0);
|
||||||
|
page.context().setDefaultNavigationTimeout(0);
|
||||||
|
await page.context().tracing.stop();
|
||||||
|
await page.pause(); // 2
|
||||||
|
})();
|
||||||
|
const recorderPage = await recorderPageGetter();
|
||||||
|
await recorderPage.click('[title="Resume"]');
|
||||||
|
await recorderPage.waitForSelector('.source-line-paused:has-text("page.pause(); // 2")');
|
||||||
|
expect(await sanitizeLog(recorderPage)).toEqual([
|
||||||
|
'page.pause- XXms',
|
||||||
|
'tracing.start- XXms',
|
||||||
|
'tracing.stop- XXms',
|
||||||
|
'page.pause',
|
||||||
|
]);
|
||||||
|
await recorderPage.click('[title="Resume"]');
|
||||||
|
await scriptPromise;
|
||||||
|
});
|
||||||
|
|
||||||
it('should show expect.toHaveText', async ({ page, recorderPageGetter }) => {
|
it('should show expect.toHaveText', async ({ page, recorderPageGetter }) => {
|
||||||
await page.setContent('<button>Submit</button>');
|
await page.setContent('<button>Submit</button>');
|
||||||
const scriptPromise = (async () => {
|
const scriptPromise = (async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue