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
@ -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}")
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 458,
|
||||
"ypos": 398,
|
||||
"width": 65,
|
||||
"height": 44,
|
||||
"type": "match",
|
||||
"match": 90
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_function_arg"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 507 KiB |
@ -1,16 +0,0 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 458,
|
||||
"ypos": 498,
|
||||
"width": 60,
|
||||
"height": 40,
|
||||
"type": "match",
|
||||
"match": 90
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_function_cos"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 509 KiB |
|
Before Width: | Height: | Size: 509 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 472,
|
||||
"ypos": 394,
|
||||
"width": 65,
|
||||
"height": 19,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_complex"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 505 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 470,
|
||||
"ypos": 425,
|
||||
"width": 98,
|
||||
"height": 21,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_programming"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 510 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 470,
|
||||
"ypos": 455,
|
||||
"width": 73,
|
||||
"height": 24,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_rounding"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 513 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 467,
|
||||
"ypos": 488,
|
||||
"width": 72,
|
||||
"height": 24,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_statistics"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 519 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 471,
|
||||
"ypos": 519,
|
||||
"width": 55,
|
||||
"height": 23,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_sundry"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_functions_sundry-20250915.png
Normal file
|
After Width: | Height: | Size: 523 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 470,
|
||||
"ypos": 360,
|
||||
"width": 98,
|
||||
"height": 24,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_functions_trigonometry"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 420 KiB |
|
Before Width: | Height: | Size: 506 KiB |
15
needles/gnome/apps/calculator/calc_result_cos-20250915.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 341,
|
||||
"ypos": 389,
|
||||
"width": 141,
|
||||
"height": 23,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_result_cos"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_result_cos-20250915.png
Normal file
|
After Width: | Height: | Size: 421 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 339,
|
||||
"ypos": 388,
|
||||
"width": 19,
|
||||
"height": 24,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_result_median"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_result_median-20250915.png
Normal file
|
After Width: | Height: | Size: 432 KiB |
15
needles/gnome/apps/calculator/calc_result_ones-20250915.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 343,
|
||||
"ypos": 383,
|
||||
"width": 198,
|
||||
"height": 36,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_result_ones"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_result_ones-20250915.png
Normal file
|
After Width: | Height: | Size: 512 KiB |
@ -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"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_result_re-20250915.png
Normal file
|
After Width: | Height: | Size: 503 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 340,
|
||||
"ypos": 387,
|
||||
"width": 20,
|
||||
"height": 28,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_result_round"
|
||||
]
|
||||
}
|
||||
BIN
needles/gnome/apps/calculator/calc_result_round-20250915.png
Normal file
|
After Width: | Height: | Size: 429 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 468,
|
||||
"ypos": 380,
|
||||
"width": 54,
|
||||
"height": 22,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_select_function_cos"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 422 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 470,
|
||||
"ypos": 442,
|
||||
"width": 59,
|
||||
"height": 23,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_select_function_median"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 439 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 469,
|
||||
"ypos": 475,
|
||||
"width": 61,
|
||||
"height": 27,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_select_function_ones"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 427 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 469,
|
||||
"ypos": 575,
|
||||
"width": 41,
|
||||
"height": 23,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_select_function_re"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 496 KiB |
@ -0,0 +1,15 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"xpos": 468,
|
||||
"ypos": 476,
|
||||
"width": 70,
|
||||
"height": 25,
|
||||
"type": "match"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"calc_select_function_round"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 428 KiB |
@ -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"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 436 KiB |
@ -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 {
|
||||
|
||||