2022-06-17 08:01:31 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
# I as a user want to be able to measure time using stopwatch.
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
# Click on the Stopwatch button.
|
|
|
|
assert_and_click("clocks_button_stopwatch");
|
|
|
|
|
|
|
|
# Start the stopwatch, pause it, resume, and clear.
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_start");
|
2022-06-17 08:01:31 +00:00
|
|
|
# Wait some time and pause the stopwatch, read the
|
|
|
|
# time.
|
|
|
|
sleep(20);
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_pause", timeout => 2);
|
2022-06-17 08:01:31 +00:00
|
|
|
assert_screen("clocks_stopwatch_time_reached");
|
|
|
|
# Resume the measurement.
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_resume");
|
2022-06-17 08:01:31 +00:00
|
|
|
sleep(10);
|
|
|
|
# Press pause and read the time.
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_pause", timeout => 2);
|
2022-06-17 08:01:31 +00:00
|
|
|
assert_screen("clocks_stopwatch_secondtime_reached");
|
|
|
|
# Clear the stopwatch and check you can start it again.
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_clear");
|
|
|
|
assert_screen("gnome_button_start");
|
2022-06-17 08:01:31 +00:00
|
|
|
|
|
|
|
# Start the stopwatch, count several laps and assert.
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_start");
|
2022-06-17 08:01:31 +00:00
|
|
|
sleep(10);
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_lap");
|
2022-06-17 08:01:31 +00:00
|
|
|
sleep(10);
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_lap");
|
2022-06-17 08:01:31 +00:00
|
|
|
sleep(10);
|
2022-11-24 13:16:20 +00:00
|
|
|
assert_and_click("gnome_button_lap");
|
|
|
|
assert_and_click("gnome_button_pause");
|
2022-06-17 08:01:31 +00:00
|
|
|
assert_screen("clocks_stopwatch_laps_count");
|
|
|
|
assert_screen("clocks_stopwatch_laps_times");
|
|
|
|
assert_screen("clocks_stopwatch_laps_deltas");
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
# Rollback when tests are over.
|
|
|
|
return {always_rollback => 1};
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|