chore: use 'Clear' step name for locator.clear() (#36208)

This commit is contained in:
Max Schmitt 2025-06-05 13:23:11 +01:00 committed by GitHub
parent 090a451866
commit b25cb7f3d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -142,7 +142,7 @@ export class Locator implements api.Locator {
}
async clear(options: channels.ElementHandleFillOptions = {}): Promise<void> {
return await this.fill('', options);
await this._frame._wrapApiCall(() => this.fill('', options), { title: 'Clear' });
}
async _highlight() {

View File

@ -1180,6 +1180,8 @@ test('should report api steps', async ({ runInlineTest, server }) => {
});
test('pass3', async () => {
await myPage.getByRole('textbox').fill('foo');
await myPage.getByRole('textbox').fill('');
await myPage.getByRole('textbox').clear();
});
test.afterAll(async () => {
@ -1202,9 +1204,11 @@ pw:api |Click locator('button') @ a.test.ts:25
hook |After Hooks
hook |Before Hooks
pw:api |Fill "foo" getByRole('textbox') @ a.test.ts:28
pw:api |Fill "" getByRole('textbox') @ a.test.ts:29
pw:api |Clear getByRole('textbox') @ a.test.ts:30
hook |After Hooks
hook | afterAll hook @ a.test.ts:31
pw:api | Close context @ a.test.ts:32
hook | afterAll hook @ a.test.ts:33
pw:api | Close context @ a.test.ts:34
hook |Before Hooks
fixture | browser
pw:api | Launch browser