code move
This commit is contained in:
parent
00257651fd
commit
a2cb11cfd6
|
|
@ -550,18 +550,17 @@ await page.Locator("#textarea").FillAsync(\"Hello'\\"\`\\nWorld\");`);
|
|||
expect(message.text()).toBe('Hello\'\"\`\nWorld');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
test('should --test-id-attribute', async ({ openRecorder }) => {
|
||||
const { page, recorder } = await openRecorder({ testIdAttributeName: 'my-test-id' });
|
||||
|
||||
await recorder.setContentAndWait(`<div my-test-id="foo">Hello</div>`);
|
||||
await page.click('[my-test-id=foo]');
|
||||
const sources = await recorder.waitForOutput('JavaScript', `page.getByTestId`);
|
||||
|
||||
expect.soft(sources.get('JavaScript')!.text).toContain(`await page.getByTestId('foo').click()`);
|
||||
expect.soft(sources.get('Java')!.text).toContain(`page.getByTestId("foo").click()`);
|
||||
expect.soft(sources.get('Python')!.text).toContain(`page.get_by_test_id("foo").click()`);
|
||||
expect.soft(sources.get('Python Async')!.text).toContain(`await page.get_by_test_id("foo").click()`);
|
||||
expect.soft(sources.get('C#')!.text).toContain(`await page.GetByTestId("foo").ClickAsync();`);
|
||||
test('should --test-id-attribute', async ({ openRecorder }) => {
|
||||
const { page, recorder } = await openRecorder({ testIdAttributeName: 'my-test-id' });
|
||||
|
||||
await recorder.setContentAndWait(`<div my-test-id="foo">Hello</div>`);
|
||||
await page.click('[my-test-id=foo]');
|
||||
const sources = await recorder.waitForOutput('JavaScript', `page.getByTestId`);
|
||||
|
||||
expect.soft(sources.get('JavaScript')!.text).toContain(`await page.getByTestId('foo').click()`);
|
||||
expect.soft(sources.get('Java')!.text).toContain(`page.getByTestId("foo").click()`);
|
||||
expect.soft(sources.get('Python')!.text).toContain(`page.get_by_test_id("foo").click()`);
|
||||
expect.soft(sources.get('Python Async')!.text).toContain(`await page.get_by_test_id("foo").click()`);
|
||||
expect.soft(sources.get('C#')!.text).toContain(`await page.GetByTestId("foo").ClickAsync();`);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue