The site I’m running automated tests on with Puppeteer displays info popups if actions were successful or when something failed. Unfortunately, these popups sometimes cover up buttons my script has to click on. It would be great if I could inject some CSS into the site to hide these popups. Is there an built-in way to do this? Answer addStyleTag:
Tag: puppeteer
How to fill an input field using Puppeteer?
I’m using Puppeteer for E2E test, and I am now trying to fill an input field with the code below: It worked, but I found the email address was typed into the field one character by one character as if a real human being was typing. Is it possible to fill the input field with the email address all at
How to click on element with text in Puppeteer
Is there any method (didn’t find in API) or solution to click on element with text? For example I have html: And I want to click on element in which text is wrapped (click on button inside .elements), like: Answer Short answer This XPath expression will query a button which contains the text “Button text”: To also respect the <div
Wait for text to appear when using Puppeteer
I wonder if there’s a similar way as in Selenium to wait for text to appear for a particular element. I’ve tried something like this, but it doesn’t seem to wait: Answer You can use waitForFunction. See https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitforfunctionpagefunction-options-args Including @elena’s solution for completeness of the answer:
How to use Puppeteer and Headless Chrome with Cucumber-js
I am trying to do BDD with cucumber-js and drive the browser testing with Headless Chrome and puppeteer. Using the documentation from cucumber node example and headless chrome, I get the following errors, the entire code base is avaliable here: github repo. Errors: TypeError: this.browser.newPage is not a function TypeError: this.browser.close is not a function // features/support/world.js // features/step_definitions/hooks.js //