Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use our own testsite in firefox html5 test #15228

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions data/testwebsites/html5_video/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for i in {1..1000} ; do ln -s /tmp/PM5544_with_non-PAL_signals.png $(printf f-%03d.png $i) ; done
ffmpeg -framerate 10 -i f-%03d.png -pix_fmt yuv420p video.webm
ffmpeg -framerate 10 -i f-%03d.png -pix_fmt yuv420p video.mp4
22 changes: 22 additions & 0 deletions data/testwebsites/html5_video/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<body>

<video controls autoplay muted>
<source src="video.webm" type="video/webm">
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

<div style="background: blue; color: yellow; font-family: sans-serif; font-size: 20px;">Video not started yet</div>

<script>
let video = document.getElementsByTagName('video')[0];
let div = document.getElementsByTagName('div')[0];
video.addEventListener('timeupdate', e => {
div.innerHTML = "Pos: " + Math.round(e.target.currentTime) + " seconds" + "<br>Source: " + video.currentSrc;
});
</script>

</body>
</html>
Binary file added data/testwebsites/html5_video/video.mp4
Binary file not shown.
Binary file added data/testwebsites/html5_video/video.webm
Binary file not shown.
1 change: 1 addition & 0 deletions lib/main_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,7 @@ sub load_x11_webbrowser {
loadtest "x11/firefox/firefox_extensions";
loadtest "x11/firefox/firefox_appearance";
loadtest "x11/firefox/firefox_passwd";
loadtest "x11/firefox/firefox_html5";
loadtest "x11/firefox/firefox_developertool";
loadtest "x11/firefox/firefox_ssl";
loadtest "x11/firefox/firefox_emaillink";
Expand Down
2 changes: 2 additions & 0 deletions schedule/qam/15-SP2/qam-regression-firefox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: qam-regression-firefox
schedule:
- boot/boot_to_desktop
- console/prepare_test_data
- x11/window_system
- x11/disable_screensaver
- x11/firefox/firefox_smoke
Expand All @@ -18,6 +19,7 @@ schedule:
- x11/firefox/firefox_extensions
- x11/firefox/firefox_appearance
- x11/firefox/firefox_passwd
- x11/firefox/firefox_html5
- x11/firefox/firefox_developertool
- x11/firefox/firefox_ssl
- x11/firefox/firefox_emaillink
Expand Down
2 changes: 2 additions & 0 deletions schedule/qam/15-SP3/qam-regression-firefox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: qam-regression-firefox
schedule:
- boot/boot_to_desktop
- console/prepare_test_data
- x11/window_system
- x11/disable_screensaver
- x11/firefox/firefox_smoke
Expand All @@ -18,6 +19,7 @@ schedule:
- x11/firefox/firefox_extensions
- x11/firefox/firefox_appearance
- x11/firefox/firefox_passwd
- x11/firefox/firefox_html5
- x11/firefox/firefox_developertool
- x11/firefox/firefox_ssl
- x11/firefox/firefox_emaillink
Expand Down
2 changes: 2 additions & 0 deletions schedule/qam/15-SP4/qam-regression-firefox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: qam-regression-firefox
schedule:
- boot/boot_to_desktop
- console/prepare_test_data
- x11/window_system
- x11/disable_screensaver
- x11/firefox/firefox_smoke
Expand All @@ -18,6 +19,7 @@ schedule:
- x11/firefox/firefox_extensions
- x11/firefox/firefox_appearance
- x11/firefox/firefox_passwd
- x11/firefox/firefox_html5
- x11/firefox/firefox_developertool
- x11/firefox/firefox_ssl
- x11/firefox/firefox_emaillink
Expand Down
31 changes: 10 additions & 21 deletions tests/x11/firefox/firefox_html5.pm
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
# SUSE's openQA tests
#
# Copyright 2009-2013 Bernhard M. Wiedemann
# Copyright 2012-2021 SUSE LLC
# Copyright 2012-2022 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Package: MozillaFirefox
# Summary: Case#1479221: Firefox: HTML5 Video
# - Launch xterm, kill firefox, cleanup previous firefox configuration, launch
# firefox
# - Open "youtube.com/html5" and check result
# - Open "youtube.com/watch?v=Z4j5rJQMdOU" and check result
# - open test html5 video page
# - Exit firefox
# Maintainer: wnereiz <wnereiz@gmail.com>

use strict;
use warnings;
use base "x11test";
use testapi;
use utils;

sub run {
my ($self) = @_;
$self->start_firefox_with_profile;

$self->firefox_open_url('youtube.com/watch?v=Z4j5rJQMdOU');
while (check_screen([qw(firefox-youtube-signin firefox-accept-youtube-cookies)], 15)) {
if (match_has_tag('firefox-accept-youtube-cookies')) {
# get to the accept button with tab and space
wait_still_screen(2);
send_key_until_needlematch('firefox-accept-youtube-cookies-agree', 'tab', 7, 1);
assert_and_click('firefox-accept-youtube-cookies-agree');
wait_still_screen(2);
next;
}
elsif (match_has_tag('firefox-youtube-signin')) {
assert_and_click('firefox-youtube-signin');
wait_still_screen(2);
next;
}
last;
}
send_key_until_needlematch('firefox-testvideo', 'spc', 30, 5);
x11_start_program('xterm');
script_run('cd ~/data/testwebsites');
enter_cmd('python3 -m http.server 48080 &');
assert_script_run 'curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 0 --retry-max-time 40 http://localhost:48080/';
$self->firefox_open_url('http://localhost:48080/html5_video');
assert_screen('firefox-testvideo');
$self->exit_firefox;
enter_cmd('exit');
}
1;