When debugging, it's useful to have screenshots from multiple test runs. At the moment, file name is created only with test suite name and test name. For example: User-should-be-able-to-create-account.png. When a new test (suite) is executed, screenshots from the previous one are overwritten.
Videos add timestamps to file names. For example: User--should-be-able-to-create-account--CHROME--04-20-2021--18-02-55-840.mp4. That makes it possible to have videos from multiple test runs.
Screenshot code is in two places.
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/tests/selenium/wdio-mediawiki/index.js#15
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/tests/selenium/wdio.conf.js#10