diff --git a/test/elementhandle.spec.js b/test/elementhandle.spec.js index fea4bb77f2..fe6f3bd00d 100644 --- a/test/elementhandle.spec.js +++ b/test/elementhandle.spec.js @@ -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');