Commit Graph
72 Commits
Author SHA1 Message Date
Johan Bay 00fc92a773 Reland^2 "eliminate initial timeout in waitForFunction"
`waitForFunction` previously always waited 100 ms before checking if
the given function is truthy. We can improve the total e2e test suite
running time by 40-50 s by eliminating this timeout. This,
unfortunately, makes some of the tests flake since they relied on this
timeout. This CL attempts to eliminate the timeout and patch the tests
that relied on it. In the cases where a test could not be patched the
timeout is inserted in the test explicitly.
Local experiments showed that this CL reduces the total runtime from
on avg. ~309 seconds to an avg. of ~264 seconds.
This amounts to a ~45 second reduction or ~15%.

This is a reland of a26e3406c7
which was a reland of 3be2087f9d

Bug: 1112692
Change-Id: I3a5156d35553415bfbac95c0251b849ed77f4767
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354096
Commit-Queue: Johan Bay <jobay@google.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-17 06:21:56 +00:00
Peter Marshall 4cafd236c0 tests: Add an it.repeat() helper
it.repeat() is helpful for fixing flaky tests.

Along with repeat, we also have the async tracing which is very helpful
for debugging tests that timeout due to hanging async operations. We
want to make all of these helpers available by default.

This CL introduces a new file mocha-extensions and adds both of these
customizations to the default mocha operations and then re-exports them.

In the future, all tests will import from mocha-extensions instead to
get these extensions by default. We will add lint rules to ensure that
callers don't import from mocha directly and miss out on these.

Bug: 1101782
Change-Id: I15dbb71493e60064288bfc050ac3f818a5c6821f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339319
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-08-14 09:10:47 +00:00
Simon Zünd f3cd1098d0 Revert "Reland "eliminate initial timeout in waitForFunction""
This reverts commit a26e3406c7.

Reason for revert: Still causes flakes on the Mac bot.
Example: https://ci.chromium.org/p/devtools-frontend/builders/ci/Stand-alone%20Mac/475

Original change's description:
> Reland "eliminate initial timeout in waitForFunction"
> 
> `waitForFunction` previously always waited 100 ms before checking if
> the given function is truthy. We can improve the total e2e test suite
> running time by 40-50 s by eliminating this timeout. This,
> unfortunately, makes some of the tests flake since they relied on this
> timeout. This CL attempts to eliminate the timeout and patch the tests
> that relied on it. In the cases where a test could not be patched the
> timeout is inserted in the test explicitly.
> Local experiments showed that this CL reduces the total runtime from
> on avg. 5:05 minutes to an avg. of 4:19 minutes.
> This amounts to a ~46 s reduction or ~15%.
> This is a reland of 3be2087f9d
> 
> Bug: 1112692
> Change-Id: Id92542de85920f95bb922d1b62ddfb63b83a055a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346366
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Commit-Queue: Johan Bay <jobay@google.com>

TBR=mathias@chromium.org,changhaohan@chromium.org,jacktfranklin@chromium.org,jobay@google.com

Change-Id: I607b04d929ec32dd518d3b6c472747a9e2e687b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1112692
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352727
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-08-13 08:49:02 +00:00
Johan Bay a26e3406c7 Reland "eliminate initial timeout in waitForFunction"
`waitForFunction` previously always waited 100 ms before checking if
the given function is truthy. We can improve the total e2e test suite
running time by 40-50 s by eliminating this timeout. This,
unfortunately, makes some of the tests flake since they relied on this
timeout. This CL attempts to eliminate the timeout and patch the tests
that relied on it. In the cases where a test could not be patched the
timeout is inserted in the test explicitly.
Local experiments showed that this CL reduces the total runtime from
on avg. 5:05 minutes to an avg. of 4:19 minutes.
This amounts to a ~46 s reduction or ~15%.
This is a reland of 3be2087f9d

Bug: 1112692
Change-Id: Id92542de85920f95bb922d1b62ddfb63b83a055a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346366
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@google.com>
2020-08-13 08:09:10 +00:00
Maksim Sadym 4d2e095852 e2e tests for Idle Emulation
Blocked by
https://bugs.chromium.org/p/chromium/issues/detail?id=1113202

Bug: 1090802
Change-Id: Icebb86770dcde77bc267470cc26426b2439f9164
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2335279
Commit-Queue: Maksim Sadym <sadym@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-08-06 09:24:37 +00:00
Sigurd Schneider d12b93955a Revert "Eliminate initial timeout in waitForFunction"
This reverts commit 3be2087f9d.

Reason for revert: Causes a lot of flakes on the devtools waterfall,
see commit 3be2087f (this CL) and the following CLs.

This is a difficult change, because discovering all test that needs
fixing is difficult. Please do land-revert-reland cycles until we've
fixed all tests. Analyzing the redness referenced above will reveal
more tests that needs fixing.

Original change's description:
> Eliminate initial timeout in waitForFunction
>
> Bug: 1112692
> Change-Id: I28bc29b0f5c2af55d3cf54614fe4d6641b64dd76
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336716
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
> Commit-Queue: Changhao Han <changhaohan@chromium.org>
> Commit-Queue: Mathias Bynens <mathias@chromium.org>

TBR=mathias@chromium.org,changhaohan@chromium.org,jacktfranklin@chromium.org,jobay@google.com

Change-Id: Id7dd3cf313cf4a74e758c28aed5400517bc5f2a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1112692
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339526
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-06 08:24:49 +00:00
Johan Bay 3be2087f9d Eliminate initial timeout in waitForFunction
Bug: 1112692
Change-Id: I28bc29b0f5c2af55d3cf54614fe4d6641b64dd76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336716
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-08-05 17:24:16 +00:00
Johan Bay 504a6f1944 Let $ return null when no element is found
This CL also changes tests to favor `waitFor` over `$` per default:
In all tests where an element is expected `$` is changed to `waitFor`.
This should be uproblematic in all the cases where an element is
expected to exist immediately, but gives a bit of leeway in case the
element is slow to emerge. Typing wise, `waitFor` never returns null
since it throws if no element is found before it times out.

Change-Id: I00b722eff34df44402d9f3bf6786432c9faf1505
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2327710
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-04 14:43:13 +00:00
Johan Bay e8245718be Use custom query handlers to implement $ and $$ in test/shared/helper.ts
Change-Id: I7c2ea2e6250bea1d15caaf1d341c56b7b2448e9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317870
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-04 14:05:13 +00:00
Philip Pfaffe 6d143ae8af [e2e] Introduce AsyncScope and remove timeout settings in test helpers
AsyncScope objects allow tracking of the current stack trace during
chains of calls to test helpers. Recording stack traces allows us to
report pending helpers when a mocha timeout occurs.

The CL also introduces an AsyncTrace help that tests use to opt into
stack tracing. Wrapping the mocha it() call is necessary to hook into the
processing of the timeout. I export the AsyncTrace helper for clarity,
but we can also wrap mocha's it() directly into our own it() wrapper to
provide a drop-in replacement. AsyncTrace's it() allows configuring the
mocha timeout locally per test. We can chose to not do that and configure
it globally, or alternatively define standard timeouts for 'fast',
'regular', or 'slow' tests.

Change-Id: I9542cdfdd78a1868a9f0fa56b8d112bd549e6f34
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2328845
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-08-03 13:49:07 +00:00
Paul Lewis 839037fe83 [TypeScript] disallow explicit any
This CL explicitly disallows use of the `any` keyword via eslint. This
is to make sure we don't accidentally miss typing info. This CL also
adds eslint-ignore statements for existing uses of any (mostly in tests)
as well as fixing a few cases where the types were simple enough to add
quickly.

R=jacktfranklin@chromium.org

Change-Id: Ia913a30d63c1ae3d969785af332a8dde512cc275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308544
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-07-21 14:31:32 +00:00
Peter Marshall c059be1548 tests: Always specify a timeout for waitFor/Function
If we use a local timeout rather than letting this timeout the whole
mocha process, we get a way better error message which includes
info about the selector/function/whatever we care about, and the
step name. Without this we just get the test file name and nothing
else.

Change-Id: Ia2882fb123a6f2b582c0dd19f3f01135b496161a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2292276
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-07-20 10:26:19 +00:00
Peter Marshall c16cedd67c tests: Don't hardcode the hosted mode server port number
(...in more than one place).

Lots of tests relied on the hosted mode server using port 8090 which
is not going to be the case once we have the parallel mocha runner
working.

Add the port number to puppeteer-state and have tests use it by
going through test/shared/helper.ts.

The port number is set at runtime rather than being a module-time
constant, so some users of the port needed to be changed to get it
after the root hooks ran instead. Future users should follow this
pattern and get the port in a before() block or during the test
itself. Or just use helpers that treat the port properly already
e.g. goToResource.

We don't send this port number to the hosted mode server yet,
so we still have this hardcoded in two places. A fix is coming in
a future CL.

Bug: 1101784
Change-Id: Ib0a7aa7a25db58d06624a1cdee6fa630cdfbe362
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2284828
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-07-07 15:43:22 +00:00
Eric Leese 66342552ce Add helpers for debugging and snippet tests
Changes include:
 - Test server handles URLs with escaping better.
 - Logging from DevTools frontend now logged by the test.
 - Helper to turn on CDP logging - for debugging only.
 - click helper improved to allow specifying maximum distance from
   left, for when an element extends far beyond its containing
   element.
 - New pressKey helper that makes keyboard shortcuts easy.
 - Helpers to modify and save a source pane and to get the text of
   the line of code where we are stopped.

Bug: 1094436
Change-Id: I389eaa680bb0771a45104f470647f67b4fa5d1d9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282811
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
2020-07-07 13:45:42 +00:00
Jose Leal Chapa 50e7bb5309 DevTools personalization - Make Security tab closeable
To be careful of not introducing breaking changes the closeable tabs work will be staggered in different CLs.
Each CL will target one single panel and will include new e2e tests that will validate:
- the panel is open by default
- the panel exists under More tools
- Closing the tab doesn't crash the devtools
- Reopening devtools persist the newly closed tab

Gif: https://imgur.com/a/LXM0ndg

Explainer:
https://docs.google.com/document/d/1TC1FxzSgRIaXmChpjL05T7sZuduRos3IDPDG5vCS1Oc/edit?usp=sharing

Overall layout personalization explainer:
https://docs.google.com/document/d/1oYBh3QeucgEV-n8BYDU_J-2wcLA4Kg1yku4jDDMcsro/edit?usp=sharing

Bug: 1074732
Change-Id: Idf4ef206c5a8b10fa73c2369394ec1ff09976e97
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167137
Commit-Queue: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-06-19 17:34:41 +00:00
Songtao Xia 67f65da531 [e2e] Tests for dual screen emulation.
Test the experimental feature of dual screen emulation.

Test the dual screen span mode exists for a dual screen device but
not for a non-dual-screen device.

Change-Id: I72b0cb4e77bb58305f112b32fd7b040436ec42c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2225335
Commit-Queue: Songtao Xia <soxia@microsoft.com>
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
2020-06-11 18:13:05 +00:00
Patrick Brosset 0805f4a033 Shared goToResource e2e helper to simplify tests
This introduces a new goToResource shared helper for all e2e puppeteer
tests to use.
It helps simplify a bunch of tests and other helpers in that they don't
need to replicate the `${resourcesPath}/some/file.html` part.
Because this helper also knows how to get hold of the target on its own
it also further simplifies other tests that don't need to import it
anymore.

The next step would be to create a shared helper that knows how to
navigate to panels inside the DevTools front-end as this is also
duplicated across tests.

Bug: 1091226
Change-Id: I717455a51dec30e153d796ef101eab3d42bc2da1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2230320
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jose Leal <joselea@microsoft.com>
2020-06-11 09:52:45 +00:00
Tim van der Lippe 421827d590 Add ninja template for copying to the gen folder
We are doing this so often and the syntax for the `outputs` arg
is difficult to remember, I figured it is better to extract out
a template. This should make it easier to copy-paste from other
BUILD.gn files as well.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1088463
Change-Id: Ic78ee5082ee5eae4e07f7ceeb21842f54dcbaf56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224807
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-06-02 10:38:50 +00:00
Tim van der Lippe d76dbd1fe3 Add node_ts_library for Node scripts
ts_library by default uses ES modules. However, Node doesn't fully
support ES modules yet, nor do our dependencies for our e2e-tests
support them fully. Therefore, transpile to commonjs for now, if
running in Node.

DISABLE_THIRD_PARTY_CHECK=Fixes to ts_library
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1088463
Change-Id: Ie6acf886417b80eb38365f9c2377799e370634fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224805
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-02 10:24:00 +00:00
Almothana Athamneh f55afd74b6 Convert Layout test for long trace trimming
This CL attempts to convert the Layout test
that tests the truncation of long messages
to a Mocha test that follows the new guidlines.

Converted Layout test can be found here: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-traces.js

Change-Id: Ie75f69c04c562a7572c232474eaaaf049bb30f1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2218007
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-28 13:51:10 +00:00
Jose Leal Chapa dd4d881300 End to end tests: Add cross tool integration tests
Bug: 1079076
Change-Id: I588fd64e5d724c1203db7b072ffc01739962941a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2186850
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jose Leal <joselea@microsoft.com>
2020-05-21 19:13:31 +00:00
Al Muthanna Athamina 889cecf7f4 Add the Step function with an example
This CL attempts to add the step function
which should help with documenting the E2E
tests with the session-storage_test an example.

Change-Id: Ib993c060c74199e85a362b67395933636ea0a1b9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159517
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
2020-04-22 15:00:19 +00:00
Tim van der Lippe 869374bcab Port shared test runner logic into separate package
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>
2020-04-20 10:32:58 +00:00
Paul Lewis 7108574e87 [e2e] Fails tests on in-page errors
Change-Id: Iba880410eab9d154d0d236b70eb7895963e252ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2130793
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-01 13:09:09 +00:00
Ted Meyer 7e5ebf014b Adds End2End test for the Media tab.
I had to add support for running the tests with chromium
--enable-features flags. This isn't on by default though, I'll leave
that up to you to turn on. The tests just exit early if the flag isn't
present.

Change-Id: I132ca71796d8f069a6fba0342f10f2f2b18c7b62
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2125249
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-31 16:29:03 +00:00
Tim van der Lippe 0ccd8de267 Fix logging of page errors in e2e-test
This will now properly show up the errors if they are thrown in
an e2e-test:

Page Error in Frontend
Error: Error: Error from sdk-legacy.js
    at http://localhost:8090/front_end/sdk/sdk-legacy.js:249:7
Page Error in Frontend
Error: Error: Error from sdk-legacy.js
    at http://localhost:8090/front_end/sdk/sdk-legacy.js:249:7
Worker (17606): /Users/tvanderlippe/Projects/devtools/devtools-frontend/test/e2e/elements/sidebar-event-listeners-remove.js

R=aerotwist@chromium.org

Change-Id: Ia171bdffc4fb28591b40277c33861ce392516d09
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2124489
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-30 11:33:52 +00:00
Paul Lewis ca9a03f92f [e2e] Adds various helpers; tidies up env vars
Change-Id: I0babf1394d62f37628c8812f9b593b40d03a30da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2124491
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-27 17:39:36 +00:00
Jack Franklin 60f529d224 Expand event listener e2e tests
This CL adds a test for listing properties of a custom event.

Bug: 1044632
Change-Id: Ibf08173ba878d68b3877399cd0e21794a9581ff2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122142
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-27 14:10:31 +00:00
Paul Lewis 417c5c06b2 [e2e] Adds support for logs and errors
This CL adds support for piping through stderr from the workers, and
adds an extra helper for logging messages from the worker to the master
process.

Change-Id: I39c31e8150456df12635f951fc6015a0bbe59960
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2123479
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-27 12:19:31 +00:00
Paul Lewis 7234471130 [e2e] Adds support for setting a timeout
This CL allows the setting of a TIMEOUT env variable to control test
timeout values.

Includes a drive-by fix on only outputting actual and expected values
when they are set.

Bug: 1062614
Change-Id: Idf444778a8a7292052a489a758b57bd2cfac81f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2123470
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-27 12:18:01 +00:00
Paul Lewis ab0c65c0d3 [e2e] Migrate selection-after-delete layout test
Bug: 1032561
Change-Id: I088d98ee73084f36944517bcc322d116e77d30bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2123473
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-27 11:12:20 +00:00
Paul Lewis e100ed2787 [e2e] drop to one job
Tests are flaking under parallelization. This drops to 1 worker.

Change-Id: Ieea4d4d13b92a402b9c229631990500bdbb99961
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2122352
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-26 17:29:51 +00:00
Paul Lewis ba8b942774 [e2e] Adds more debugging info
This adds the full expected and actual values to the log.
TBR=tvanderlippe@chromium.org

Change-Id: I93fb0497d701e01f29d5039b7d94b0d60f66f706
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119549
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-26 12:13:00 +00:00
Paul Lewis ae5e8fb631 Adds support for e2e parallelization
Change-Id: I9af281bc40223a5ceb2a6f71ce247970beea4b02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2116050
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-25 16:45:33 +00:00
Tim van der Lippe 98583637e9 Add README for end-to-end tests
The shared README should be done in a follow-up, as it requires additional
documentation in the `helper.ts` functions as well.

R=aerotwist@chromium.org

Change-Id: I665c9f07b8002fb395b7de2b202d1589472366db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2115634
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-24 11:09:12 +00:00
Tim van der Lippe a797aeed7d Add ts_library for test/e2e/application
Also adds the relevant ts_library definitions for the helpers
and shared code.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I14087afc05d4aadee611cc317b1d2485f3826d20
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2112552
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-23 12:37:51 +00:00
Mathias Bynens fc24634880 Remove mkdirp helper
We can use the native `fs.mkdirSync` instead as long as we set the
`recursive: true` option. This way, we don’t have to awkwardly pass
each path component as a separate array element, and we can now more
clearly represent paths as path strings throughout the code.

Change-Id: I83515d09a13844dccc41dd72943c59295aebdcb1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-03-20 13:30:07 +00:00
Mathias Bynens 7472956749 Add e2e test for vision deficiency simulation
For now we only assert that the UI is present in the Rendering
panel, and that the <select> contains the expected options.

Bug: chromium:1003700
Change-Id: I57a9dd283850b1970a6e498eae60047efccd8733
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108149
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-19 15:48:42 +00:00
Tim van der Lippe e4a10affd8 Extract tsconfig.base.json to obtain VSCode compatible tsconfig.json
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>
2020-03-16 11:15:51 +00:00
Tim van der Lippe c2cb4301c9 Add missing license headers
In a follow-up CL we will be porting the license header check to ESLint.
This allows us to add missing license headers for TypeScript-authored
files. The script found some missing license headers already, which this
CL adds.

Change-Id: Id5041813281d2a7151297f9ed29baabc1cfd85af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097991
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-12 14:53:52 +00:00
Peter Marshall 3181426885 [test] Add an e2e test for console let re-declaration
The test just checks that the most basic repl-mode let re-declaration
returns the correct result. There are way more tests for the repl-mode
logic in V8.

Drive-by update to obtainConsoleMessages to use waitFor helper.

Change-Id: I68ec4526537ef62b544be91d49e229ab6ea380f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078233
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-12 13:51:20 +00:00
Eric Leese 588278b24f More tests for scripts shared between workers
This change fixes a flaky test, adds a substitute for the webtest
breakpoints-ui-restored-breakpoint.js so that test can be removed
from blink, and adds testing of breaking in multiple workers.

Bug: chromium:670180
Change-Id: I3695b4239be1a064e886fa3912843febe2fde9a3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087764
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-11 11:12:16 +00:00
Tim van der Lippe 68efc70843 Add e2etest for shadow root styles
This replaces
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/devtools/startup/shadow-dom-rules.js;l=1;drc=45107a2b20f840bd1833c33ffdd6383fb56de32d?originalUrl=https:%2F%2Fcs.chromium.org%2F
as an e2etest

R=aerotwist@chromium.org

Bug: 1044632
Change-Id: Id8fbfa0bfac16c096dfeae788addabd809994b63
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2085171
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 12:00:04 +00:00
Paul Lewis f57a5e85c0 [e2e] Migrates http/tests/devtools/user-metrics-perf.js to e2e
Original test at https://cs.chromium.org/chromium/src/third_party/blink/web_tests/http/tests/devtools/user-metrics-perf.js?q=http/tests/devtools/user-metrics-perf.js&sq=package:chromium&g=0&l=1

This is a stripped back version of the original layout test, since the
other user metrics e2e tests already test that we get shown events (and
not load events) when switching panels. Therefore this test only checks
that we get load events.

Bug: 1032561, 1046784
Change-Id: I460b3384ac313f75066478c8f809dc59b9b02d41
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2084582
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-03 16:18:04 +00:00
Mathias Bynens 23ee1aad0a Reconfigure lint rule w.r.t. quotes
We prefer single quotes by default, but still want to allow double
quotes in cases where that helps avoid quote-escaping, and also want
to allow template literals in cases where string interpolation is
used. For example:

    const a = 'xxx';  // ok
    const b = "xxx";  // not ok, should use single quotes
    const c = "xxx'xxx";  // ok, double quotes avoid an escape sequence
    const d = `xxx`;  // not ok, frivolous use of template literal
    const e = `xxx ${42}`;  // ok

Per https://github.com/eslint/eslint/issues/12976, setting
the `allowTemplateLiterals` option for the `quotes` lint rule to
`false` gives us the desired behavior.

Note that the above lint rules are auto-fixed when running the linter;
there should be no need to manually make any changes to appease the
linter.

Per review feedback, this patch also removes the following escape
sequences for printable non-ASCII symbols:

- U+00D7 → ×
- U+2026 → …
- U+2019 → ’

Chromium CL temporarily updating test expectations:
https://chromium-review.googlesource.com/c/chromium/src/+/2083147

Cq-Depend: chromium:2083147
Bug: chromium:1057042
Change-Id: Id6bec3f96ca694d2fbc07dd8629fce305a58df8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2082372
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-03-02 16:18:16 +00:00
Paul Lewis 36122adbd3 [e2e] Migrate http/tests/devtools/search/sources-search-scope.js to e2e
Original test at https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/devtools/search/sources-search-scope.js;l=1;drc=77578ccb4082ae20a9326d9e673225f1189ebb63?originalUrl=https:%2F%2Fcs.chromium.org%2F

Bug: 1032561, 1046784
Change-Id: I3ba6790afedbb88ffbb0f79e8543d6d5440d9fb0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078234
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 12:35:48 +00:00
Paul Lewis 65761161be [perf] Updates boot perf test
Change-Id: I7d8f9cf62638230a1d912c7c12beca02a2883bfa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2077658
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-28 10:40:09 +00:00
Jack Franklin 9e6296cd62 Update screenshot testing to enable element screenshots
Often when testing components we won't want to screenshot the entire
page but instead just a given element. This change updates our testing
API to expose two functions; one to test an element and one to test an
entire page.

Bug: 1051458
Change-Id: I1e410e0085e9038c4345dd815aa3f4b6fa39f9ce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2074762
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-02-27 16:08:27 +00:00
Tim van der Lippe 54c6faa18b Add e2etest for cacheable responses in the network panel
I also discovered that the checkboxes we had in DevTools where not
properly accessible. While there was some logic to let a label element
be the aria-describedby for the input element, because they were both in
the shadow dom, it didn't do anything. Setting the appropriate
aria-label fixes that issue.

Secondly, the hosted_mode server now implements caching based on ETags.

This replaces
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/http/tests/devtools/startup/resource-tree/resource-tree-mimetype.js;l=1;drc=77578ccb4082ae20a9326d9e673225f1189ebb63?originalUrl=https:%2F%2Fcs.chromium.org%2F
as an e2etest

Bug: 1044632
Change-Id: I3283b791d1d9a9673363d7cbb897d3f5c6c03ed0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2062603
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-20 16:02:26 +00:00
Paul Lewis bf2de16258 [screenshot] Makes screenshots platform-specific
Bug: 1051458
Change-Id: I36902abbebdeba4938be7e516a33caa2f4501944
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2065010
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-20 14:11:15 +00:00