selenium: Create local ./log directory if needed
Without this, the tests sometimes fail like this:
> Error: ENOENT: no such file or directory, open './log/should-be-creatable.png'
> at screenshot() - saveScreenshot.js:52:17
> at saveScreenshot("./log/should-be-creatable.png")
This seems to race with the junit plugin, which uses mkdirp to
create it if missing, but the screenshot handling is separate
from that. WebdriverIO's own screenshot handling also does this
so it makes sense for ours to do that, too.
I considered trying to re-use WebdriverIO's save mechanism,
directly but it's not publicly exposed and only used for the
crash scenario, so for now we'll have to keep our own.
Also:
* Add to gitignore.
* Update default to use __dirname instead of './' because the
latter will somtimes be mediawiki/ and sometimes be selenium/
depending on whether you run all tests or some tests.
* Remove trailing slash from default logPath, and instead add the
slash in filePath.
Reason:
- The LOG_DIR used by Jenkins doesn't end in a slash either
(currently not failing because we no longer use that job,
and let quibble run the tests instead, which doesn't set
the LOG_DIR).
- The WDIO docs and example also use screenshotPath without
trailing slash.
- Without this, setting LOG_DIR=/tmp/something results in
filenames like /tmp/somethingexample.png.
Bug: T193088
Change-Id: I6550f9315bae89f96a791f7ae8cc2fbec5ee8dd5