1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-11-10 20:15:59 +00:00

Change subroutine to test Functions

Calculator changed the way functions are organized within the
application which broke the current Calculator test.

This fixes the subroutine to test for Functions and makes the
test reliable again.

Fixes: https://pagure.io/fedora-qa/os-autoinst-distri-fedora/issue/428
This commit is contained in:
Lukáš Růžička 2025-09-15 14:07:37 +02:00 committed by Adam Williamson
parent fa8e16aff8
commit ae9e757384
42 changed files with 248 additions and 49 deletions

View File

@ -176,9 +176,11 @@ for button in ("div", "divider", "zero", "one", "two", "three", "four", "five",
"six","seven", "eight", "nine", "mod", "percent", "sub"):
testtags.append(f"calc_button_{button}")
testtags.append(f"kcalc_button_{button}")
for function in ("sqrt", "arg", "cos"):
testtags.append(f"calc_function_{function}")
for function in ("sqrt", "median", "cos", "ones", "re", "round"):
testtags.append(f"calc_select_function_{function}")
testtags.append(f"calc_result_{function}")
for category in ("complex", "programming", "rounding", "statistics", "trigonometry", "sundry"):
testtags.append(f"calc_functions_{category}")
for result in ("BokZw", "Czo4s", "O9qsL", "WIxiR", "b5y2B", "h7MfO", "qxuBK",
"tWshx", "uC8Ul", "3LAG3"):
testtags.append(f"calc_result_{result}")

View File

@ -1,16 +0,0 @@
{
"area": [
{
"xpos": 458,
"ypos": 398,
"width": 65,
"height": 44,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"calc_function_arg"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

View File

@ -1,16 +0,0 @@
{
"area": [
{
"xpos": 458,
"ypos": 498,
"width": 60,
"height": 40,
"type": "match",
"match": 90
}
],
"properties": [],
"tags": [
"calc_function_cos"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 472,
"ypos": 394,
"width": 65,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_complex"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 470,
"ypos": 425,
"width": 98,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_programming"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 470,
"ypos": 455,
"width": 73,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_rounding"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 467,
"ypos": 488,
"width": 72,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_statistics"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 471,
"ypos": 519,
"width": 55,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_sundry"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 470,
"ypos": 360,
"width": 98,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_functions_trigonometry"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 341,
"ypos": 389,
"width": 141,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_result_cos"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 339,
"ypos": 388,
"width": 19,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_result_median"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 343,
"ypos": 383,
"width": 198,
"height": 36,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_result_ones"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

View File

@ -1,15 +1,15 @@
{
"area": [
{
"xpos": 347,
"xpos": 345,
"ypos": 385,
"width": 10,
"height": 32,
"width": 25,
"height": 26,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_result_arg"
"calc_result_re"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 340,
"ypos": 387,
"width": 20,
"height": 28,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_result_round"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 468,
"ypos": 380,
"width": 54,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_select_function_cos"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 470,
"ypos": 442,
"width": 59,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_select_function_median"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 469,
"ypos": 475,
"width": 61,
"height": 27,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_select_function_ones"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 469,
"ypos": 575,
"width": 41,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_select_function_re"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 468,
"ypos": 476,
"width": 70,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_select_function_round"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

View File

@ -1,15 +1,15 @@
{
"area": [
{
"xpos": 465,
"ypos": 471,
"width": 58,
"xpos": 469,
"ypos": 408,
"width": 54,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"calc_function_sqrt"
"calc_select_function_sqrt"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

View File

@ -7,14 +7,15 @@ use utils;
# can use pre-selected functions.
sub use_function {
my $function = shift;
my ($function, $where, $expression) = @_;
assert_and_click("calc_button_fxunified");
send_key_until_needlematch("calc_function_$function", "down", 50);
click_lastmatch();
assert_and_click("calc_button_five");
assert_and_click("calc_functions_$where");
assert_and_click("calc_select_function_$function");
type_safely($expression);
send_key("ret");
assert_screen("calc_result_$function");
assert_and_click("calc_button_clear");
sleep(1);
}
sub run {
@ -22,9 +23,12 @@ sub run {
# Wait until everything settles.
sleep 5;
use_function("sqrt");
use_function("arg");
use_function("cos");
use_function("cos", "trigonometry", "45");
use_function("re", "complex", "20");
use_function("ones", "programming", "5");
use_function("round", "rounding", "5.55");
use_function("median", "statistics", "1;2;4;5");
use_function("sqrt", "sundry", "5");
}
sub test_flags {