Commit Graph

526 Commits

Author SHA1 Message Date
Andrey Lushnikov
0414dfa98b Introduce DEBUG module
This patch re-introduces the DEBUG module to expose some of
the puppeteer's internals.

Currently, only the protocol message communication is exposed under
the 'puppeteer:protocol' namespace.
2017-07-17 15:15:07 -07:00
Pavel Feldman
4581ada210 Roll chromium to r486981. (#87)
This patch rolls chromium to r486981 and prepares
for the introduction of device emulation.
2017-07-17 12:15:06 -07:00
Andrey Lushnikov
d99031ba46 [doclint] Move doclint under utils/
This patch:
- moves doclint under utils/ folder
- adds tests to verify doclint basic functionality

This patch also drops the jasmine as a spec runner for the doclint
checks. It turned out it's hard to customize jasmine's behavior,
so instead this patch implements a dummy spec runner.

The dummy spec runner allows us:
- to format messages however we want (the custom jasmine reporter would
  also allow us to do this)
- to avoid `beforeAll` functions which pollute global to pass
  initialized variables over to specs

References #14
2017-07-13 00:28:52 -07:00
Andrey Lushnikov
b0a2cf662e Roll chromium to r485143 2017-07-11 19:38:20 -07:00
Andrey Lushnikov
a0eeb415f2 Introduce yarn debug-unit command
The command runs the puppeteer testsuite with the '--inspect-brk' node
flag. This makes it possible to connect to the testsuite with
Chrome DevTools and debug it.

Fixes #57.
2017-07-07 13:08:36 -07:00
Andrey Lushnikov
193f0d85cb Enable documentation linting (#56)
This patch enables documentation linting as a part of `npm run lint`
command.

References #14.
2017-07-07 21:53:55 +03:00
Andrey Lushnikov
62cacbe5f5 Implement documentation linter (#47)
This patch implements documentation linter, which leaves under `test/doclint`
folder.

The documentation linter works like this:
1. Parse javascript source code with esprima and construct a "documentation" out of source code
2. Generate HTML out of `api.md` and traverse the HTML with puppeteer.
3. Make sure javascript aligns nicely with HTML

The documentation linter adds the following commands:
- `yarn doc` - to test that documentation covers all the relevant apis
- `yarn generate-toc` - to update the table-of-contents for the `api.md`
2017-07-07 19:36:45 +03:00
Andrey Lushnikov
0d2c32e8cd Roll chromium to r484159 2017-07-05 17:02:58 -07:00
Andrey Lushnikov
175963182e Implement FrameManager
This patch implements FrameManager which is responsible for maintaining
the frame tree. FrameManager is quite basic: it sends FrameAttached,
FrameDetached and FrameNavigated events, and can report mainFrame and
all frames.

The next step would be moving certain Page API's to the Frame. For
example, such method as Page.evaluate, Page.navigate and others should
be available on Frame object as well.

References #4
2017-06-21 14:11:52 -07:00
Paul Irish
a66480a416 Fix ESLint failures (#34)
References #33
2017-06-21 14:11:52 -07:00
Paul Irish
a033b1b7ac Add travis config (#29)
This patch: 
- adds travis
- adds eslint as required in devdeps
- cleans up travis yml
2017-06-21 14:11:52 -07:00
Eric Bidelman
e73d22a564 use npm 2017-06-21 14:11:52 -07:00
Eric Bidelman
96e5736528 Add lint script and editorconfig file 2017-06-21 14:11:52 -07:00
Eric Bidelman
f185ab749f Fix readme example 2017-06-21 14:11:52 -07:00
Andrey Lushnikov
9de48fb51e Merge goldentest.js into test.js
This patch introduces a custom jasmine matcher which compares
images to golden results. As a result, it becomes possible
to incorporate the goldentest.js into test.js.

This allows to write tests in a unified way.
2017-06-16 21:42:47 -07:00
Andrey Lushnikov
25e0bac461 add missing pngjs module 2017-06-16 15:02:14 -07:00
Andrey Lushnikov
242a6a6e73 Introduce screenshot tests
This patch introduces a goldentest.js. The tests inside
the file should rely on "golden" results rather then asserts.

For now, goldentest.js allows only image expectations. If the
actual result doesn't match the expected result, the two files
are created under `test/output` folder:
- The '-actual.png' contains the actual test result
- The '-diff.png' contains the diff between images
2017-06-16 14:33:34 -07:00
Andrey Lushnikov
28a3343d2c Add the missing 'ws' dependency. 2017-06-16 13:55:23 -07:00
Andrey Lushnikov
67932b87c1 Drop the chrome-remote-interface dependency
This patch drops the chrome-remote-interface dependency and
introduces Connection class which handles all the communication
with remote target.

Closes #3
2017-06-14 15:45:59 -07:00
Andrey Lushnikov
79ceb0c439 Consolidate phantom shim code in the phantom-shim folder
This patch:
- renames phantomjs folder into phantom_shim
- moves bin/puppeteer into a phantom_shim/runner.js and
  merges the file with phantomjs/index.js
- removes "bin" field from the package.json - it is confusing
  to have phantom shim installable
2017-06-14 02:27:19 -07:00
Andrey Lushnikov
143f633d3c Cleanup package dependencies
Phantom shim requires a bunch of dependencies which are not needed by
the puppeteer itself.

This patch moves these dependencies to the devDependencies.
2017-06-13 20:14:45 -07:00
Andrey Lushnikov
e1d9b29666 Roll chromium to r478524
This patch rolls chromium to r478524, which is a current Canary
version. This version fixes recent test regressions.
2017-06-11 22:44:50 -07:00
Andrey Lushnikov
c08f1447bb Slight code restructuring
This patch:
- moves phantom shim shell into a bin/ folder
- introduces a new root index.js which exposes Browser to the
  dependent modules
- adds forgotten LICENSE header to the install.js
2017-05-14 23:28:00 -07:00
Andrey Lushnikov
72ce46c4f6 Roll chromium to r471584 2017-05-14 20:07:27 -07:00
Andrey Lushnikov
6fc54665e4 Add minimal test framework
This patch adds some minimal tests for puppeteer's Page using
Jasmine.
2017-05-12 16:38:07 -07:00
Andrey Lushnikov
2cda8c18d1 Puppeteer: staging commit. 2017-05-11 00:06:41 -07:00