mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
test(selectText): restore firefox tests (#1829)
This commit is contained in:
parent
da24fe12a6
commit
5ec2c58a75
@ -328,19 +328,29 @@ describe('ElementHandle.fill', function() {
|
||||
});
|
||||
|
||||
describe('ElementHandle.selectText', function() {
|
||||
it.fail(FFOX)('should select textarea', async({page, server}) => {
|
||||
it('should select textarea', async({page, server}) => {
|
||||
await page.goto(server.PREFIX + '/input/textarea.html');
|
||||
const textarea = await page.$('textarea');
|
||||
await textarea.evaluate(textarea => textarea.value = 'some value');
|
||||
await textarea.selectText();
|
||||
expect(await page.evaluate(() => window.getSelection().toString())).toBe('some value');
|
||||
if (FFOX) {
|
||||
expect(await textarea.evaluate(el => el.selectionStart)).toBe(0);
|
||||
expect(await textarea.evaluate(el => el.selectionEnd)).toBe(10);
|
||||
} else {
|
||||
expect(await page.evaluate(() => window.getSelection().toString())).toBe('some value');
|
||||
}
|
||||
});
|
||||
it.fail(FFOX)('should select input', async({page, server}) => {
|
||||
it('should select input', async({page, server}) => {
|
||||
await page.goto(server.PREFIX + '/input/textarea.html');
|
||||
const input = await page.$('input');
|
||||
await input.evaluate(input => input.value = 'some value');
|
||||
await input.selectText();
|
||||
expect(await page.evaluate(() => window.getSelection().toString())).toBe('some value');
|
||||
if (FFOX) {
|
||||
expect(await input.evaluate(el => el.selectionStart)).toBe(0);
|
||||
expect(await input.evaluate(el => el.selectionEnd)).toBe(10);
|
||||
} else {
|
||||
expect(await page.evaluate(() => window.getSelection().toString())).toBe('some value');
|
||||
}
|
||||
});
|
||||
it('should select plain div', async({page, server}) => {
|
||||
await page.goto(server.PREFIX + '/input/textarea.html');
|
||||
|
Loading…
Reference in New Issue
Block a user