From 929b7d979baf4b16bd59445324b75b9a8da643b0 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Mon, 13 Jan 2020 17:13:36 -0800 Subject: [PATCH] test(selectors): should auto-detect css selector with attributes (#477) --- test/queryselector.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/queryselector.spec.js b/test/queryselector.spec.js index 7e4b70983c..85b37d1cfb 100644 --- a/test/queryselector.spec.js +++ b/test/queryselector.spec.js @@ -61,6 +61,11 @@ module.exports.describe = function({testRunner, expect, product, FFOX, CHROMIUM, const idAttribute = await page.$eval('section', e => e.id); expect(idAttribute).toBe('testAttribute'); }); + it('should auto-detect css selector with attributes', async({page, server}) => { + await page.setContent('
43543
'); + const idAttribute = await page.$eval('section[id="testAttribute"]', e => e.id); + expect(idAttribute).toBe('testAttribute'); + }); it('should accept arguments', async({page, server}) => { await page.setContent('
hello
'); const text = await page.$eval('section', (e, suffix) => e.textContent + suffix, ' world!');