garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.67k stars 605 forks source link

Allow to modify `gotoParameters` #1444

Closed marcinmaruszewski closed 1 year ago

marcinmaruszewski commented 1 year ago

This PR will introduce a new option for both scenarios or the general engineOptions parameter.

It will allow users to modify both Puppeteer and Playwright parameters on page.goto(url, parameters).

Examples

  1. Modify general engine options
"engineOptions": {
  "gotoParameters": { "waitUntil": "networkidle0" },
}
  1. Modify engine options for a single scenario

"scenarios": [
  {
    "label": "domcontentloaded",
    "url": "https://example.com"
    "gotoParameters": { "waitUntil": "domcontentloaded" },
  }
]

But why?

I've noticed that the default waitUntil parameter for Playwright which is the load value is not enough when BackstopJS is creating images for my website. In order to fix it I had to create a patch. I'd like to add it to the core as my piece of contribution.

This PR also fixes some small coding standards issues in the core/command/remote.js file.

garris commented 1 year ago

Great enhancement -- thank you!