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

[REGRESSION]: Unclear error message when undefined is passed to page.click() #1735

Closed
celeryclub opened this issue Apr 9, 2020 · 1 comment · Fixed by #1795
Closed

[REGRESSION]: Unclear error message when undefined is passed to page.click() #1735

celeryclub opened this issue Apr 9, 2020 · 1 comment · Fixed by #1795
Assignees

Comments

@celeryclub
Copy link
Contributor

celeryclub commented Apr 9, 2020

Context:

  • GOOD Playwright Version: 0.12.1
  • BAD Playwright Version: 0.13.0
  • Operating System: macOS

Code Snippet

const { chromium } = require('playwright-chromium');

(async () => {
  const browser = await chromium.launch({ headless: false });
  const page = await browser.newPage();
  
  const myObject = {};
  await page.goto('https://www.google.com', { waitUntil: 'networkidle0' });
  await page.click(myObject.undefinedProperty);

  await browser.close();
})();

Describe the bug

Hi team. Thanks for all the great work on 0.13.0! It's looking really good. I did find one small regression in the error messaging.

0.12.1 gives me this:

TimeoutError: waiting for selector "undefined" failed: timeout 30000ms exceeded

0.13.0 gives me this:

TypeError: Cannot read property 'length' of undefined

It's a bit hard to understand what that means. To be clear I don't actually think 0.12.1 is truly "good" in this case either since I think it makes sense to fail fast when a nullish value is passed.

Thanks for taking a look!

@pavelfeldman
Copy link
Member

I wonder if there is anything we can do to validate the parameter types across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants