Page MenuHomePhabricator

Video recording for Selenium tests in Node.js
Closed, ResolvedPublic

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
mediawiki/vagrant$ vagrant ssh
...

vagrant@vagrant:~$ cd /vagrant/mediawiki

vagrant@vagrant:/vagrant/mediawiki$ sudo apt-get install ffmpeg xvfb
...

vagrant@vagrant:/vagrant/mediawiki$ export DISPLAY=:94

vagrant@vagrant:/vagrant/mediawiki$ Xvfb "$DISPLAY" -screen 0 1280x1024x24 &
[1] 2053

vagrant@vagrant:/vagrant/mediawiki$ ffmpeg -f x11grab  -video_size 1280x1024 -i "$DISPLAY" -loglevel error -nostdin -pix_fmt yuv420p log/selenium.mp4 &
...

vagrant@vagrant:/vagrant/mediawiki$ npm run selenium
...

vagrant@vagrant:/vagrant/mediawiki$ killall ffmpeg Xvfb
  • open mediawiki/vagrant/mediawiki/log/selenium.mp4 on your desktop machine

ffmpeg -f x11grab -video_size 1280x1024 -i "$DISPLAY" -loglevel error -nostdin -pix_fmt yuv420p log/selenium.mp4 &

[[ https://ffmpeg.org/ffmpeg.html | ffmpeg ]] a very fast video and audio converter that can also grab from a live audio/video source
[[ https://ffmpeg.org/ffmpeg.html#X11-grabbing | -f x11grab ]] grab the X11 display with ffmpeg
[[ http://ffmpeg.org/ffmpeg-utils.html#Video-size | -video_size 1280x1024 ]]
[[ https://ffmpeg.org/ffmpeg.html#Main-options | -i :99 ]] input file url
-loglevel error logs only errors
-nostdin allows running in the background (&)
-pix_fmt yuv420p QuickTime Player support, "Use -pix_fmt yuv420p for compatibility with outdated media players."
log/selenium.mp4 output file
& run in background

Change 422933 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[mediawiki/core@master] WIP Selenium: record video

https://gerrit.wikimedia.org/r/422933

Change 422949 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[integration/config@master] WIP Selenium: record video

https://gerrit.wikimedia.org/r/422949

Change 423161 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[mediawiki/core@master] WIP Selenium: update WebdriverIO configuration

https://gerrit.wikimedia.org/r/423161

Created testing job: mediawiki-core-qunit-selenium-jessie-422933. Video recording works! :)

The job is no longer needed, so I will delete it. The usual mediawiki-core-qunit-selenium-jessie job records videos. Example from mediawiki-core-qunit-selenium-jessie/18108:

zeljkofilipin rescinded a token.
zeljkofilipin awarded a token.

Change 423161 merged by jenkins-bot:
[mediawiki/core@master] Selenium: update WebdriverIO configuration

https://gerrit.wikimedia.org/r/423161

Change 422949 abandoned by Zfilipin:
WIP Selenium: record video

Reason:
implemented in https://gerrit.wikimedia.org/r/#/c/424592

https://gerrit.wikimedia.org/r/422949

The last video (User-should-be-able-to-change-preferences.mp4) is not saved correctly in Jenkins. All other files are saved correctly. It works fine in mediawiki-vagrant. I am not sure how to fix that. :/

@hashar, do you have any ideas?

Change 425788 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[integration/config@master] WIP killall ffmpeg

https://gerrit.wikimedia.org/r/425788

The last video (User-should-be-able-to-change-preferences.mp4) is not saved correctly in Jenkins. All other files are saved correctly. It works fine in mediawiki-vagrant. I am not sure how to fix that. :/

I have tried to fix the CI problem with 425788, but it did not help. 🤔

Change 425788 abandoned by Zfilipin:
WIP killall ffmpeg

https://gerrit.wikimedia.org/r/425788

Not working on it at the moment. Will resume soon.

We have some more seemingly random failures going on with https://gerrit.wikimedia.org/r/c/mediawiki/extensions/AdvancedSearch/+/455170/18 and again videos would be super awesome!

Change 462656 had a related patch set uploaded (by Zfilipin; owner: Hashar):
[mediawiki/core@master] selenium: video recording reporter

https://gerrit.wikimedia.org/r/462656

zeljkofilipin lowered the priority of this task from High to Medium.Sep 25 2018, 11:26 AM
zeljkofilipin updated the task description. (Show Details)

Change 422933 merged by jenkins-bot:
[mediawiki/core@master] Selenium: record video of every test

https://gerrit.wikimedia.org/r/422933

zeljkofilipin updated the task description. (Show Details)

Reusing this task. The Jenkins job selenium-daily-beta-MediaWiki fails due to lack of ffmpeg:

[chrome #0-0] 1) BlankPage "before each" hook:
[chrome #0-0] spawn ffmpeg ENOENT
[chrome #0-0] Error: spawn ffmpeg ENOENT

The job uses docker-registry.wikimedia.org/releng/npm-browser-test:0.3.1, we would want to add the ffmpeg package into it.

zeljkofilipin claimed this task.

The Jenkins job selenium-daily-beta-MediaWiki fails due to lack of ffmpeg:

Thanks, reported as T210516.

Change 462656 abandoned by Hashar:
selenium: video recording reporter

https://gerrit.wikimedia.org/r/462656