mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test(selectors): should auto-detect css selector with attributes (#477)
This commit is contained in:
parent
d529ef95d2
commit
929b7d979b
@ -61,6 +61,11 @@ module.exports.describe = function({testRunner, expect, product, FFOX, CHROMIUM,
|
|||||||
const idAttribute = await page.$eval('section', e => e.id);
|
const idAttribute = await page.$eval('section', e => e.id);
|
||||||
expect(idAttribute).toBe('testAttribute');
|
expect(idAttribute).toBe('testAttribute');
|
||||||
});
|
});
|
||||||
|
it('should auto-detect css selector with attributes', async({page, server}) => {
|
||||||
|
await page.setContent('<section id="testAttribute">43543</section>');
|
||||||
|
const idAttribute = await page.$eval('section[id="testAttribute"]', e => e.id);
|
||||||
|
expect(idAttribute).toBe('testAttribute');
|
||||||
|
});
|
||||||
it('should accept arguments', async({page, server}) => {
|
it('should accept arguments', async({page, server}) => {
|
||||||
await page.setContent('<section>hello</section>');
|
await page.setContent('<section>hello</section>');
|
||||||
const text = await page.$eval('section', (e, suffix) => e.textContent + suffix, ' world!');
|
const text = await page.$eval('section', (e, suffix) => e.textContent + suffix, ' world!');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user