Commit Graph

1314 Commits

Author SHA1 Message Date
Andrey Lushnikov
609e763381
test(firefox): enable screenshot tests for Firefox (#3942)
References #3889
2019-02-07 07:59:14 -08:00
Andrey Lushnikov
49e8704ba8
test(firefox): enable more tests on Puppeteer-Firefox (#3937)
References #3889
2019-02-07 07:15:19 -08:00
Andrey Lushnikov
96792793ea
chore(ci): enable firefox on travis (#3935)
References #3889
2019-02-06 16:34:38 -08:00
Andrey Lushnikov
a762dbe96f
chore(ci): add Puppeteer-Firefox to CI (#3932)
This patch adds Puppeteer-Firefox bot running on Linux+Node8
on Cirrus CI.

References #3889
2019-02-06 14:28:02 -08:00
Andrey Lushnikov
6887ad881a
chore: further unify Puppeteer-Firefox tests with Puppeteer (#3931)
This patch:
* unifies assets between tests
* enables a few puppeteer tests on Puppeteer-Firefox

Drive-by: beautify failing output of `expect.toEqual` matcher.

References #3889
2019-02-06 13:49:14 -08:00
Paul Irish
c3b6619432 chore(firefox): readme link to isready site (#3930) 2019-02-06 10:06:36 -08:00
Andrey Lushnikov
14fb3e38db
chore(firefox): mark all Puppeteer tests that are failing on FF (#3924)
This patch:
- introduces new testRunner methods `addTestDSL` and `addSuiteDSL`
  to add annotated test / suite.
- introduces new test/suite declaration methods: `it_fails_ffox` and
  `describe_fails_ffox`. These are equal to `it`/`describe` for chromium
  tests and to `xit`/`xdescribe` for firefox.
- marks all unsupported tests with `it_fails_ffox`
- adds a new command-line flag `'--firefox-status'` to `//test/test.js`.
  This flag dumps current amount of tests that are intentionally skipped
  for Firefox.

End goal: get rid of all `it_fails_ffox` and `describe_fails_ffox`
tests.

Drive-By: remove cookie tests  "afterEach" hook that was removing
cookies - it's not needed any more since every test is run in a
designated browser context.

References #3889
2019-02-05 22:32:41 -08:00
Andrey Lushnikov
86783c2495
chore(firefox): run all tests without "UnhandledPromiseRejection" error (#3922)
This aligns all Puppeteer tests so that they never throw the
"UnhandledPromiseRejection" when run with Puppeteer-Firefox.

With this patch, the `npm run funit` passes 275 of 460 Puppeteer tests.

References #3889.
2019-02-05 19:49:47 -08:00
Andrey Lushnikov
bc71e9236d
chore(testrunner): nicer colors for test reporter (#3921) 2019-02-05 19:02:29 -08:00
Andrey Lushnikov
1676f9927c
chore(firefox): move sources from //lib/firefox to //lib (#3920) 2019-02-05 18:56:04 -08:00
Andrey Lushnikov
a210dd7ee2
chore(testrunner): show 5 slowest tests on CI (#3919)
Show top slowest tests on CI.

Drive-by: some facelifting for the test reporter.
2019-02-05 15:28:35 -08:00
Andrey Lushnikov
00bcecbf72
chore: increase test timeout to 20 seconds on Appveyour (#3918)
Looks like Appveyour is indeed slow; try giving it more time
to run tests.

Drive-by: support TIMEOUT env variable for Puppeteer tests.
2019-02-05 13:38:56 -08:00
Andrey Lushnikov
28087c291f
feat(firefox): support ElementHandle.contentFrame() (#3917) 2019-02-05 13:29:49 -08:00
Andrey Lushnikov
dd8bd6dcb1
test(firefox): support Puppeteer-Firefox specific env variables (#3907)
This patch:
- adds support to `FFOX` env variable for Puppeteer testsuite
- install Firefox preferences when running tests with custom firefox
  executable

References #3889
2019-02-05 13:17:02 -08:00
Andrey Lushnikov
e1000009a5
docs(api.md): update versions (#3916) 2019-02-05 12:46:31 -08:00
Andrey Lushnikov
a760d79c86
chore: bump version to v1.12.2-post (#3915) 2019-02-05 12:00:15 -08:00
Andrey Lushnikov
b0afb17b68
chore: mark version v1.12.2 (#3914) 2019-02-05 11:38:04 -08:00
Joel Einbinder
6e1f7dc992 feat(chromium): roll chromium to r624492 (#3909)
This roll includes:
- https://crrev.com/624492 - Disable sending KeyUpdates by default.

Fixes #3893, #3880
2019-02-05 11:25:18 -08:00
Andrey Lushnikov
69c434af75
test(firefox): further unify Puppeteer-Firefox and Puppeteer tests (#3894)
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.
2019-02-02 18:49:12 -07:00
Andrey Lushnikov
47fbb117f5
test(firefox): add more Puppeteer-Firefox tests to Puppeteer (#3892)
References #3889
2019-02-02 12:55:15 -07:00
Andrey Lushnikov
b5e53fdbf4
test(firefox): add puppeteer-firefox unique evaluation tests (#3891)
References #3889
2019-02-01 18:40:40 -08:00
Andrey Lushnikov
6bb0350b4d
test(firefox): introduce vendor-specific specs (#3890)
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
2019-02-01 17:55:12 -08:00
Andrey Lushnikov
84fe6014e9
chore(firefox): run Puppeteer-Firefox against Puppeteer tests (#3888)
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
2019-02-01 17:04:19 -08:00
Andrey Lushnikov
fd67fa7a36
test(firefox): run puppeteer-firefox tests in browser contexts (#3887)
This patch starts running all Puppeteer-Firefox tests in separate
browser contexts.
2019-02-01 14:52:25 -08:00
Andrey Lushnikov
bd347558bc
feat(ppfox): implement browser contexts (#3872)
BrowserContexts are necessary to run Puppeteer tests against Puppeteer-Firefox
2019-02-01 14:09:18 -08:00
Andrey Lushnikov
b0e8084650
chore: bump version to v1.12.1-post (#3886) 2019-02-01 12:47:56 -08:00
Andrey Lushnikov
a1abd6c1fc
chore: mark version v1.12.1 (#3885)
References #3878.
2019-02-01 12:30:21 -08:00
Joel Einbinder
23b74650a3 fix(types): disable shipping our own d.ts file (#3882)
It looks like this was a breaking change for people using DefinitelyTyped's definitions. Let's revert, and revisit it for 2.0

References #3878, #2079
2019-02-01 09:55:46 -08:00
Andrey Lushnikov
718cdf123e
chore: bump version to v1.12.0-post (#3876) 2019-01-31 19:47:16 -08:00
Andrey Lushnikov
7f05a084f1
chore: mark version v1.12.0 (#3875) 2019-01-31 19:33:54 -08:00
Joel Einbinder
5cca7c0cae fix(types): don't report events as class members (#3874) 2019-01-31 17:53:16 -08:00
Andrey Lushnikov
3c516f2114
chore: move static constructor to the top (#3873) 2019-01-31 17:33:38 -08:00
Andrey Lushnikov
d89ec00122
fix(ppfox): check directory existance if necessary when running tests (#3871) 2019-01-31 17:30:34 -08:00
Andrey Lushnikov
a2f1e2774a
fix: ignore console messages from destroyed execution contexts (#3866)
Fix #3865
2019-01-30 16:19:02 -08:00
Andrey Lushnikov
7001042f79
fix(launcher): properly disable translate UI (#3863)
Fix #3858
2019-01-28 17:19:53 -08:00
Andrey Lushnikov
61bc51c33a
fix: update device descriptors (#3862)
Fix #3859
2019-01-28 17:19:33 -08:00
Andrey Lushnikov
a064a6341b
feat(page): introduce page.setDefaultTimeout (#3854)
Method `page.setDefaultTimeout` overrides default 30 seconds timeout
for all `page.waitFor*` methods, including navigation and waiting
for selectors.

Fix #3319.
2019-01-28 17:16:12 -08:00
Joel Einbinder
f2c968fdb8 chore(types): generate our own d.ts file from api.md (#3744)
Generate `//index.d.ts` file with precise typescript definitions for all of the
Puppeteer API.
2019-01-28 15:12:45 -08:00
Andrey Lushnikov
63d9ac4df8
fix(executioncontext): follow up to properly adopt element handles (#3857)
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.
2019-01-28 14:20:28 -08:00
Andrey Lushnikov
55432f88e9
fix(page): execute frame.waitFor{Selector,XPath} in secondary world (#3856)
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
2019-01-28 12:24:27 -08:00
Andrey Lushnikov
2061dd4718
fix(page): teach waitForSelector to return null (#3846)
`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.
2019-01-28 14:24:53 -05:00
Dan Dascalescu
7446550fdb docs(api.md): fix typo (#3848) 2019-01-27 00:37:02 -05:00
Andrey Lushnikov
62da2366c6
chore: introduce //lib/api.js (#3835)
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.
2019-01-25 23:21:14 -05:00
Andrey Lushnikov
cd678fb591
chore(juggler): Roll Firefox to 120450a2 (#3842)
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
2019-01-25 15:25:54 -05:00
Andrey Lushnikov
1a7995558f
chore(test): prepare tests to be run with Puppeteer-Firefox (#3833)
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.
2019-01-24 01:04:42 -05:00
Denny
7585e6db9e docs(api.md): expand puppeteer-core explanation (#3830) 2019-01-22 23:25:14 -05:00
Andrey Lushnikov
fb710120e9
feat(page): use secondary world to drive clicks (#3828)
References #2671
2019-01-22 23:24:14 -05:00
Andrey Lushnikov
89a5c396bf
refactor: move to flatten protocol (#3827)
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.
2019-01-22 18:10:11 -05:00
Andrey Lushnikov
678b8e85ad
fix(page): use secondary DOMWorld to drive page.select() (#3809)
This patch starts creating secondary DOMWorld for every connected
page and switches `page.select()` to run inside the secondary world.

Fix #3327.
2019-01-22 17:55:33 -05:00
Andrey Lushnikov
c09835fd70
feat(chromium): roll Chromium to r624487 (#3817)
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
2019-01-22 13:56:24 -05:00