test: add tests for selectors matching root behavior (#3744)
This commit is contained in:
parent
469541a0b9
commit
5c3bf5bf3e
|
|
@ -119,3 +119,9 @@ it('should work with attribute selectors', async ({page}) => {
|
|||
expect(await page.$eval(`[attr*=hello] >> span`, e => e.parentNode === window['div'])).toBe(true);
|
||||
expect(await page.$eval(`[attr3="] span"] >> span`, e => e.parentNode === window['div'])).toBe(true);
|
||||
});
|
||||
|
||||
it('should not match root after >>', async ({page, server}) => {
|
||||
await page.setContent('<section><div>test</div></section>');
|
||||
const element = await page.$('css=section >> css=section');
|
||||
expect(element).toBe(null);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -204,3 +204,11 @@ it('should waitForSelector with distributed elements', async ({page, server}) =>
|
|||
const handle = await promise;
|
||||
expect(await handle.textContent()).toBe('Hello from light');
|
||||
});
|
||||
|
||||
it('should match root after >>', async ({page, server}) => {
|
||||
await page.setContent('<section>test</section>');
|
||||
const element = await page.$('css=section >> text=test');
|
||||
expect(element).toBeTruthy();
|
||||
const element2 = await page.$('text=test >> text=test');
|
||||
expect(element2).toBeTruthy();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue