This patch:
- changes Puppeteer-Firefox plumbing of defaultBrowserOptions to align
with the way we do it for Puppeteer.
- plumbs puppeeteer-dependent Errors and DeviceDescriptors down to every
test.
- unifies a few tests between Puppeteer-Firefox and Puppeteer.
**Note:** in future, we should expose errors as `puppeteer.errors` and
device descriptors as `puppeteer.devices` to make it easy to pass around
Puppeteer/Puppeteer-Firefox instance.
References #3889.
Certain Puppeteer methods do expose the inner browser - e.g.
`browser.version()` depends on the browser we run.
Split out these tests into a vendor-specific test suites.
References #3889
Introduce a `npm run funit` script that runs puppeteer tests
against Puppeteer-Firefox.
Next steps:
- bring Puppeteer-Firefox unique tests to Puppeteer
- skip failing tests and run Puppeteer-Firefox on CI
- work through tests to pass them all with Puppeteer-Firefox
Method `page.setDefaultTimeout` overrides default 30 seconds timeout
for all `page.waitFor*` methods, including navigation and waiting
for selectors.
Fix#3319.
The `executionContextId` argument was missing, which made all
element handles to resolve in the main world. All our tests pass
atm, but this would've fired back when we exposed extension
execution contexts.
This patch starts executing frame.waitForSelector and frame.waitForXPath
in secondary world. As a result, websites that mutate page global
context (e.g. removing global MutationObserver) don't break Puppeteer's
behavior.
Fixes#609
`page.waitForSelector` should return `null` if waiting for `hidden:
true` and there's no matching node in DOM.
Before this patch, `page.waitForSelector` would return some JSHandle
pointing to boolean value.
Introduce `//lib/api.js` that declares a list of publicly exposed
classes.
The `//lib/api.js` list superceedes dynamic `helper.tracePublicAPI()` calls
and is used in the following places:
- [ASYNC STACKS]: generate "async stacks" for publicy exposed API in `//index.js`
- [COVERAGE]: move coverage support from `//lib/helper` to `//test/utils`
- [DOCLINT]: get rid of 'exluded classes' hardcoded list
This will help us to re-use our coverage and doclint infrastructure
for Puppeteer-Firefox.
Drive-By: it turns out we didn't run coverage for `SecurityDetails`
class, so we lack coverage for a few methods there. These are excluded
for now, sanity tests will be added in a follow-up.
This patch:
- rebaselines C++ patchset atop of [Global Firefox Reformat](https://bugzilla.mozilla.org/show_bug.cgi?id=1511181)
- rolls firefox to [120450a2](120450a2c5)
- splits out preference installation step from Puppeteer-Firefox's
`install.js` into a separate
`puppeteer-firefox/misc/install-preferences.js`. This script is
re-used to install preferences when run with a custom executable path.
- fixes issue with ScrollbarManager that was re-injecting the same
stylesheet multiple times
This patch aligns Puppeteer testing infrastructure with the approach
we use in Puppeteer-Firefox.
This patch:
- makes all tests accept Puppeteer object as a function argument
rather than require it statically. This way we can pass either
Puppeteer or Puppeteer-Firefox to drive tests.
- renames the `puppeteer.spec.js` into `launcher.spec.js`. The
`puppeteer.spec.js` is now the entry point for all cross-browsers
tests.
DevTools protocol is dropping nested targets and switching to
flatten protocol. This patch adopts the new scheme.
Once this change lands, tip-of-tree Puppeteer will be incompatible
with Chromium below 72.0.3606.0. Chromium 72 goes stable on [Jan, 29](https://www.chromestatus.com/features/schedule) - the same time we release the
next version of Puppeteer, so this change won't hurt those clients who try using
tip-of-tree Puppeteer with stable chrome.
For the record: the previous attempt to land this was https://github.com/GoogleChrome/puppeteer/pull/3524.
This roll includes:
- https://crrev.com/624247 - DevTools: Allow DOM.resolveNode to resolve
into isolated worlds
- https://crrev.com/624486 - DevTools: addScriptToEvaluateOnNewDocument
should work with disabled javascript
This patch splits out `IsolatedWorld` class from Frame.
The `IsolatedWorld` abstraction is an execution context
with a designated set of DOM wrappers.
References #2671
Tracing is working on a per-browser level, not per-page. In order
to paralellize these tests effectively and properly, each should run
a designated browser.
Drop requirement for matching "origin" and "content-type" headers
in requests and request interceptions. This way javascript redirects
that use form submission start working.
Fix#3684.