Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selector visible and hidden #2203

Closed
Prev Previous commit
Next Next commit
Update waittask.spec.js
  • Loading branch information
yael118 committed May 12, 2020
commit 301de3afdf6aecc45d1b9adb833da1e4191d6c50
7 changes: 7 additions & 0 deletions test/waittask.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ describe('Frame.waitForSelector', function() {
const waitForSelector = page.waitForSelector('div');
expect(await page.evaluate(x => x.textContent, await waitForSelector)).toBe("hi! I'm visible");
});
it('should find hidden selector when there is another element visible', async({page, server}) => {
let divFound=false
await page.setContent(`<div>content</div><div hidden="hidden">content</div>`);
const waitForSelector = page.waitForSelector('div',{state:"hidden"}).then(divFound=true);
await waitForSelector;
expect(divFound).toBe(true);
});

it('should wait for visible', async({page, server}) => {
let divFound = false;
Expand Down