[e2e] Apply error reporting hooks also in beforeX and afterX cases
[e2e] Apply error reporting hooks also in beforeX and afterX cases

When our mocha tests time out, hooks around it() make sure that we
print pending promises and log a screenshot. This CL makes the same work
for beforeX and afterX mocha hooks.

Bug: none
Change-Id: Ibb0a6c1ddb3dae6690bdee45374bc70bf67c5688
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3819722
Reviewed-by: Alex Rudenko <d8d88e7d7e77f69e23d1d1432231196fb8e02a62@chromium.org>
Commit-Queue: Philip Pfaffe <639a645feae3653b7aaefa0387217d375f2f82ff@chromium.org>
Auto-Submit: Philip Pfaffe <639a645feae3653b7aaefa0387217d375f2f82ff@chromium.org>
Commit-Queue: Alex Rudenko <d8d88e7d7e77f69e23d1d1432231196fb8e02a62@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend