Skip to content

Commit d99f6e9

Browse files
authored
chore: move shouldPauseBeforeStep into protocol.yml (#36964)
1 parent c41d1be commit d99f6e9

File tree

4 files changed

+160
-93
lines changed

4 files changed

+160
-93
lines changed

packages/playwright-core/src/server/debugger.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,24 +130,13 @@ function shouldPauseOnCall(sdkObject: SdkObject, metadata: CallMetadata): boolea
130130
}
131131

132132
function shouldPauseBeforeStep(metadata: CallMetadata): boolean {
133-
// Don't stop on internal.
134133
if (metadata.internal)
135134
return false;
136-
// Always stop on 'close'
137-
if (metadata.method === 'close')
138-
return true;
139-
if (metadata.method === 'waitForSelector' || metadata.method === 'waitForEventInfo' || metadata.method === 'querySelector' || metadata.method === 'querySelectorAll')
140-
return false; // Never stop on those, primarily for the test harness.
141-
const step = metadata.type + '.' + metadata.method;
142-
// Stop before everything that generates snapshot. But don't stop before those marked as pausesBeforeInputActions
143-
// since we stop in them on a separate instrumentation signal.
144-
const metainfo = methodMetainfo.get(step);
145-
if (metainfo?.internal)
146-
return false;
147-
return !!metainfo?.snapshot && !metainfo.pausesBeforeInput;
135+
const metainfo = methodMetainfo.get(metadata.type + '.' + metadata.method);
136+
return !!metainfo?.pausesBeforeAction;
148137
}
149138

150-
export function shouldSlowMo(metadata: CallMetadata): boolean {
139+
function shouldSlowMo(metadata: CallMetadata): boolean {
151140
const metainfo = methodMetainfo.get(metadata.type + '.' + metadata.method);
152141
return !!metainfo?.slowMo;
153142
}

0 commit comments

Comments
 (0)