The shared test runner logic was reimplementing parts of Mocha,
in particular the test logging and filtering. Moreover, it was
booting the hosted mode server and puppeteer outside of Mocha.
Mocha supports root level hooks [1]. These hooks allow us to
perform work before a test starts. Moreover, by using the
before and after hook, we can run logic before and after
all tests.
By using these hooks, we can extract the "boot the hosted mode
server and hookup puppeteer" part to these root hooks.
Additionally, we can reset the pages in the `beforeEach`, which
means that tests themselves don't have to reset the pages.
We also put the implementation code into third_party/conductor,
as we would like to reuse this logic for the Puppeteer tests.
The Puppeteer test suite now also uses Mocha and has very
similar requirements as to our DevTools tests. By extracting
from DevTools, we can look into expanding the test runner to
other usecases, but that is out of scope for now.
[1]: https://mochajs.org/#root-level-hooks
Bug: 1071369
Change-Id: Ie9f954359d9de84da564b74b6f5517dd535db008
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150458
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
VS Code requires all files including .d.ts files to be included in order
to correctly resolve their definitions. However, we can't add the
include and exclude keywords to the tsconfig.json, as that would break
inheriting tsconfig.json configurations.
Therefore, extract a tsconfig.base.json with the original configuration
and let tsconfig.json extend it. This should instruct VS Code to use the
tsconfig, which includes all files, while all other infrastructure can
remain working as-is.
R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=TypeScript update
Fixed: 1056211
Change-Id: Ib4d127c745a3e69fd8c8c77eb0fb20c3a68689b1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095299
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
There were multiple issues:
1. The e2e project was accidentally recompiling the shared files again,
thus we needed to use project references for that
2. There was a difference in configuration of the root project and the
e2etests. As such, make sure to extend the root config.
3. The code was being transpiled down to es5, which is not necessary as
we run a recent version of Node. Thus, we can use `esnext` instead.
Debugging scripts should now be a lot easier, especially as
`async-await` are no longer transpiled.
For now, strict is turned off, as there are various errors that pop up.
I will clean that up in a follow-up CL.
Bug: 1044632
Change-Id: Ie0cf29a1ddd1e027bcc107d2567283eaaaa7fead
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2047183
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
We plan to have multiple suites using the same machinery that currently
runs the e2e. This CL moves that machinery out to a shared folder and
remaps the e2e code to use everything in the new locations.
Future CLs will introduce additional suites for capturing traces,
screenshots, and other artifact.
Change-Id: I452424d8f65fb03897f5a59606c592be996e91ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035949
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>