test: update selection expectations after roll (#21124)

https://github.com/microsoft/playwright/issues/20820
This commit is contained in:
Yury Semikhatsky 2023-02-22 17:24:04 -08:00 committed by GitHub
parent 3ff3567c89
commit f61d02e46f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ it('should select textarea', async ({ page, server, browserName }) => {
const textarea = await page.$('textarea');
await textarea.evaluate(textarea => textarea.value = 'some value');
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.selectionEnd)).toBe(10);
} else {
@ -35,7 +35,7 @@ it('should select input', async ({ page, server, browserName }) => {
const input = await page.$('input');
await input.evaluate(input => input.value = 'some value');
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.selectionEnd)).toBe(10);
} else {

View File

@ -80,7 +80,7 @@ it('should select textarea', async ({ page, server, browserName }) => {
const textarea = page.locator('textarea');
await textarea.evaluate(textarea => (textarea as HTMLTextAreaElement).value = 'some value');
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).selectionEnd)).toBe(10);
} else {

View File

@ -239,7 +239,7 @@ it('input value retargeting', async ({ page, browserName }) => {
await expect(target).toHaveValue('bar');
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.selectionEnd)).toBe(3);
} else {