Page MenuHomePhabricator

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

Details

Related Gerrit Patches:
mediawiki/core : masterselenium: video recording reporter
mediawiki/core : masterSelenium: record video of every test
integration/config : masterWIP killall ffmpeg
integration/config : masterWIP Selenium: record video
mediawiki/core : masterSelenium: update WebdriverIO configuration

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin awarded a token.
zeljkofilipin added a subscriber: hashar.
zeljkofilipin added a comment.EditedMar 28 2018, 4:11 PM
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
zeljkofilipin awarded a token.
zeljkofilipin added a comment.EditedMar 29 2018, 10:33 AM

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

ffmpeg a very fast video and audio converter that can also grab from a live audio/video source
-f x11grab grab the X11 display with ffmpeg
-video_size 1280x1024
-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

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

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

zeljkofilipin awarded a token.

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

zeljkofilipin awarded a token.

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

zeljkofilipin removed zeljkofilipin as the assignee of this task.Jun 4 2018, 2:46 PM

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

I would love this for debugging T201337

zeljkofilipin updated the task description. (Show Details)Aug 9 2018, 3:52 PM
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)

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!

gabriel-wmde added a subscriber: gabriel-wmde.

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 closed this task as Resolved.Oct 17 2018, 10:10 AM
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin awarded a token.
hashar reopened this task as Open.Oct 18 2018, 8:02 AM

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 removed zeljkofilipin as the assignee of this task.Oct 24 2018, 12:08 PM
zeljkofilipin closed this task as Resolved.Nov 27 2018, 4:17 PM
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