selenium: prevent webdriverio automatic screenshot
authorAntoine Musso <hashar@free.fr>
Fri, 22 Feb 2019 13:58:27 +0000 (14:58 +0100)
committerAntoine Musso <hashar@free.fr>
Fri, 22 Feb 2019 13:58:27 +0000 (14:58 +0100)
commit569624953600cac567347c611e26b17142a7106b
treee664b0d30762ca821c493d0f86ad1ea6add66e1b
parent901d0a6dced1851271a0ea53925d6183c40936f4
selenium: prevent webdriverio automatic screenshot

When the wdio configuration has screenshotPath, when a test fail a
screenshot is automatically taken. However there is no support to
specify a filename, we thus went with our own handler in afterTest hook
to have the screenshot names after the full test name.

As a result we had two screenshots taken:

A) CHROME-Error-xxx.png
B) Suite-Sometest.png

Set screenshotPath to null which disable the automatic screenshoting.
Adjust rest of code to use logPath as a base path to save screenshots.

As a side effect, it works around a nasty race condition in the
reporting. The report is generated while some test still has an
afterTest hook running. The report fail to generate and cause nodejs to
exit. The exact fix still has to be figured out though. T216818.

Bug: T216818
Change-Id: I4b53c98bd4de0d9ff850bb883ba899dd1dce0274
tests/selenium/wdio.conf.js