1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-08-04 07:55:44 +00:00
os-autoinst-distri-fedora/tests/applications/calculator/constants.pm
Lukáš Růžička d12a4173fb Add new Calculator tests for added buttons
New button were added to the Calculator's Basic view,
which allow access to constants and functions. In this test,
we check some of the constants and functions.
2025-07-18 15:20:55 +02:00

91 lines
2.6 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
# This script checks that Gnome Calculator
# can use pre-selected constants.
sub run {
my $self = shift;
# Wait until everything settles.
sleep 5;
# Check that upper index can be used
assert_and_click("calc_button_four");
assert_and_click("calc_button_upper");
assert_and_click("calc_button_two");
assert_and_click("calc_button_equals");
assert_screen("calc_result_sixteen");
assert_and_click("calc_button_clear");
# Check that lower index works
# I cannot think of a math expression that would use
# subscripts, so let's just check the button works.
assert_and_click("calc_button_four");
assert_and_click("calc_button_lower");
assert_and_click("calc_button_four");
assert_screen("calc_result_foursub");
assert_and_click("calc_button_clear");
# This will check the unified buttons that
# represents various mathematical expressions.
# We will only check a couple of them.
#
# Pi:
assert_and_click("calc_button_one");
assert_and_click("calc_button_xunified");
assert_and_click("calc_umenu_mathematical");
assert_and_click("calc_umenu_pi");
send_key("ret");
assert_screen("calc_result_314");
assert_and_click("calc_button_clear");
# Lightspeed
assert_and_click("calc_button_one");
assert_and_click("calc_button_multi");
assert_and_click("calc_button_xunified");
assert_and_click("calc_umenu_electromagnetic");
assert_and_click("calc_umenu_lightspeed");
send_key("ret");
assert_screen("calc_result_2997");
assert_and_click("calc_button_clear");
# Electron mass
assert_and_click("calc_button_one");
assert_and_click("calc_button_xunified");
assert_and_click("calc_umenu_atomic");
assert_and_click("calc_umenu_electronmass");
send_key("ret");
assert_screen("calc_result_9109");
assert_and_click("calc_button_clear");
# Avogadro
assert_and_click("calc_button_one");
assert_and_click("calc_button_xunified");
assert_and_click("calc_umenu_thermo");
assert_and_click("calc_umenu_avogadro");
send_key("ret");
assert_screen("calc_result_6022");
assert_and_click("calc_button_clear");
# Earth acceleration
assert_and_click("calc_button_one");
assert_and_click("calc_button_xunified");
assert_and_click("calc_umenu_gravitation");
assert_and_click("calc_umenu_acceleration");
send_key("ret");
assert_screen("calc_result_9806");
assert_and_click("calc_button_clear");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et: