mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: update selection expectations after roll (#21124)
https://github.com/microsoft/playwright/issues/20820
This commit is contained in:
parent
3ff3567c89
commit
f61d02e46f
@ -22,7 +22,7 @@ it('should select textarea', async ({ page, server, browserName }) => {
|
|||||||
const textarea = await page.$('textarea');
|
const textarea = await page.$('textarea');
|
||||||
await textarea.evaluate(textarea => textarea.value = 'some value');
|
await textarea.evaluate(textarea => textarea.value = 'some value');
|
||||||
await textarea.selectText();
|
await textarea.selectText();
|
||||||
if (browserName === 'firefox') {
|
if (browserName === 'firefox' || browserName === 'webkit') {
|
||||||
expect(await textarea.evaluate(el => el.selectionStart)).toBe(0);
|
expect(await textarea.evaluate(el => el.selectionStart)).toBe(0);
|
||||||
expect(await textarea.evaluate(el => el.selectionEnd)).toBe(10);
|
expect(await textarea.evaluate(el => el.selectionEnd)).toBe(10);
|
||||||
} else {
|
} else {
|
||||||
@ -35,7 +35,7 @@ it('should select input', async ({ page, server, browserName }) => {
|
|||||||
const input = await page.$('input');
|
const input = await page.$('input');
|
||||||
await input.evaluate(input => input.value = 'some value');
|
await input.evaluate(input => input.value = 'some value');
|
||||||
await input.selectText();
|
await input.selectText();
|
||||||
if (browserName === 'firefox') {
|
if (browserName === 'firefox' || browserName === 'webkit') {
|
||||||
expect(await input.evaluate(el => el.selectionStart)).toBe(0);
|
expect(await input.evaluate(el => el.selectionStart)).toBe(0);
|
||||||
expect(await input.evaluate(el => el.selectionEnd)).toBe(10);
|
expect(await input.evaluate(el => el.selectionEnd)).toBe(10);
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ it('should select textarea', async ({ page, server, browserName }) => {
|
|||||||
const textarea = page.locator('textarea');
|
const textarea = page.locator('textarea');
|
||||||
await textarea.evaluate(textarea => (textarea as HTMLTextAreaElement).value = 'some value');
|
await textarea.evaluate(textarea => (textarea as HTMLTextAreaElement).value = 'some value');
|
||||||
await textarea.selectText();
|
await textarea.selectText();
|
||||||
if (browserName === 'firefox') {
|
if (browserName === 'firefox' || browserName === 'webkit') {
|
||||||
expect(await textarea.evaluate(el => (el as HTMLTextAreaElement).selectionStart)).toBe(0);
|
expect(await textarea.evaluate(el => (el as HTMLTextAreaElement).selectionStart)).toBe(0);
|
||||||
expect(await textarea.evaluate(el => (el as HTMLTextAreaElement).selectionEnd)).toBe(10);
|
expect(await textarea.evaluate(el => (el as HTMLTextAreaElement).selectionEnd)).toBe(10);
|
||||||
} else {
|
} else {
|
||||||
|
@ -239,7 +239,7 @@ it('input value retargeting', async ({ page, browserName }) => {
|
|||||||
await expect(target).toHaveValue('bar');
|
await expect(target).toHaveValue('bar');
|
||||||
|
|
||||||
await target.selectText();
|
await target.selectText();
|
||||||
if (browserName === 'firefox') {
|
if (browserName === 'chromium' || browserName === 'webkit') {
|
||||||
expect(await page.locator('#target').evaluate((el: HTMLInputElement) => el.selectionStart)).toBe(0);
|
expect(await page.locator('#target').evaluate((el: HTMLInputElement) => el.selectionStart)).toBe(0);
|
||||||
expect(await page.locator('#target').evaluate((el: HTMLInputElement) => el.selectionEnd)).toBe(3);
|
expect(await page.locator('#target').evaluate((el: HTMLInputElement) => el.selectionEnd)).toBe(3);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user