2022-10-13 13:01:53 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
# This part of the suite tests if the volume levels
|
|
|
|
# are reflected in the volume bar in the control menu.
|
|
|
|
#
|
|
|
|
|
|
|
|
sub check_volume {
|
|
|
|
my $level = shift;
|
|
|
|
# Check that the volume indicator changes
|
|
|
|
assert_screen("panel_volume_indicator_$level");
|
|
|
|
# Open the control menu and check the volume bar
|
|
|
|
# shows the status of the volume level.
|
|
|
|
assert_and_click("panel_controls");
|
|
|
|
assert_screen("panel_volume_bar_$level");
|
|
|
|
# Close the control window
|
|
|
|
send_key("esc");
|
|
|
|
wait_still_screen(2, similarity_level => 38);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
|
|
|
# Open the terminal to enable us to set the
|
|
|
|
# volume level.
|
2024-10-10 00:14:55 +00:00
|
|
|
desktop_launch_terminal;
|
2022-10-13 13:01:53 +00:00
|
|
|
assert_screen("apps_run_terminal");
|
|
|
|
# Set the volume to 0%
|
2023-07-17 12:30:05 +00:00
|
|
|
type_safely('amixer -D pipewire sset Master 0%');
|
2023-06-23 08:52:33 +00:00
|
|
|
send_key('ret');
|
2022-10-13 13:01:53 +00:00
|
|
|
# Check that it worked
|
|
|
|
check_volume("zero");
|
|
|
|
# Set the volume to 50%
|
2023-07-17 12:30:05 +00:00
|
|
|
type_safely('amixer -D pipewire sset Master 50%');
|
2023-06-23 08:52:33 +00:00
|
|
|
send_key('ret');
|
2022-10-13 13:01:53 +00:00
|
|
|
# Check that it worked
|
|
|
|
check_volume("fifty");
|
|
|
|
# Set the volume to 100%
|
2023-07-17 12:30:05 +00:00
|
|
|
type_safely('amixer -D pipewire sset Master 100%');
|
2023-06-23 08:52:33 +00:00
|
|
|
send_key('ret');
|
2022-10-13 13:01:53 +00:00
|
|
|
# Check that it worked
|
|
|
|
check_volume("hundred");
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return {always_rollback => 1};
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|