Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/playwright-core/src/client/locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class Locator implements api.Locator {
}

async clear(options: channels.ElementHandleFillOptions = {}): Promise<void> {
return await this.fill('', options);
return this._frame._wrapApiCall(() => this.fill('', options), { title: 'Clear' });
}

async _highlight() {
Expand Down
8 changes: 6 additions & 2 deletions tests/playwright-test/test-step.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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
Expand Down
Loading