diff --git a/check-needles.py b/check-needles.py index f94142cb..edf3bc9e 100755 --- a/check-needles.py +++ b/check-needles.py @@ -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}") diff --git a/needles/gnome/apps/calculator/calc_function_arg-20250718.json b/needles/gnome/apps/calculator/calc_function_arg-20250718.json deleted file mode 100644 index 767511fa..00000000 --- a/needles/gnome/apps/calculator/calc_function_arg-20250718.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "area": [ - { - "xpos": 458, - "ypos": 398, - "width": 65, - "height": 44, - "type": "match", - "match": 90 - } - ], - "properties": [], - "tags": [ - "calc_function_arg" - ] -} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_function_arg-20250718.png b/needles/gnome/apps/calculator/calc_function_arg-20250718.png deleted file mode 100644 index b20d1d0c..00000000 Binary files a/needles/gnome/apps/calculator/calc_function_arg-20250718.png and /dev/null differ diff --git a/needles/gnome/apps/calculator/calc_function_cos-20250718.json b/needles/gnome/apps/calculator/calc_function_cos-20250718.json deleted file mode 100644 index ea87a054..00000000 --- a/needles/gnome/apps/calculator/calc_function_cos-20250718.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "area": [ - { - "xpos": 458, - "ypos": 498, - "width": 60, - "height": 40, - "type": "match", - "match": 90 - } - ], - "properties": [], - "tags": [ - "calc_function_cos" - ] -} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_function_cos-20250718.png b/needles/gnome/apps/calculator/calc_function_cos-20250718.png deleted file mode 100644 index b2f9262f..00000000 Binary files a/needles/gnome/apps/calculator/calc_function_cos-20250718.png and /dev/null differ diff --git a/needles/gnome/apps/calculator/calc_function_sqrt-20250718.png b/needles/gnome/apps/calculator/calc_function_sqrt-20250718.png deleted file mode 100644 index db10e4bf..00000000 Binary files a/needles/gnome/apps/calculator/calc_function_sqrt-20250718.png and /dev/null differ diff --git a/needles/gnome/apps/calculator/calc_functions_complex-20250915.json b/needles/gnome/apps/calculator/calc_functions_complex-20250915.json new file mode 100644 index 00000000..fee19706 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_complex-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 472, + "ypos": 394, + "width": 65, + "height": 19, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_complex" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_complex-20250915.png b/needles/gnome/apps/calculator/calc_functions_complex-20250915.png new file mode 100644 index 00000000..ff50ddc7 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_complex-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_functions_programming-20250915.json b/needles/gnome/apps/calculator/calc_functions_programming-20250915.json new file mode 100644 index 00000000..86517d90 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_programming-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 470, + "ypos": 425, + "width": 98, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_programming" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_programming-20250915.png b/needles/gnome/apps/calculator/calc_functions_programming-20250915.png new file mode 100644 index 00000000..0f8ed53a Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_programming-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_functions_rounding-20250915.json b/needles/gnome/apps/calculator/calc_functions_rounding-20250915.json new file mode 100644 index 00000000..ad94d339 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_rounding-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 470, + "ypos": 455, + "width": 73, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_rounding" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_rounding-20250915.png b/needles/gnome/apps/calculator/calc_functions_rounding-20250915.png new file mode 100644 index 00000000..3904797a Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_rounding-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_functions_statistics-20250915.json b/needles/gnome/apps/calculator/calc_functions_statistics-20250915.json new file mode 100644 index 00000000..e469812d --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_statistics-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 467, + "ypos": 488, + "width": 72, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_statistics" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_statistics-20250915.png b/needles/gnome/apps/calculator/calc_functions_statistics-20250915.png new file mode 100644 index 00000000..0797824f Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_statistics-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_functions_sundry-20250915.json b/needles/gnome/apps/calculator/calc_functions_sundry-20250915.json new file mode 100644 index 00000000..4575a07e --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_sundry-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 471, + "ypos": 519, + "width": 55, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_sundry" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_sundry-20250915.png b/needles/gnome/apps/calculator/calc_functions_sundry-20250915.png new file mode 100644 index 00000000..fec37de6 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_sundry-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.json b/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.json new file mode 100644 index 00000000..588748c3 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 470, + "ypos": 360, + "width": 98, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_functions_trigonometry" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.png b/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.png new file mode 100644 index 00000000..1e18f024 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_functions_trigonometry-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_result_arg-20250718.png b/needles/gnome/apps/calculator/calc_result_arg-20250718.png deleted file mode 100644 index 3482972f..00000000 Binary files a/needles/gnome/apps/calculator/calc_result_arg-20250718.png and /dev/null differ diff --git a/needles/gnome/apps/calculator/calc_result_cos-20250915.json b/needles/gnome/apps/calculator/calc_result_cos-20250915.json new file mode 100644 index 00000000..ee957254 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_result_cos-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 341, + "ypos": 389, + "width": 141, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_result_cos" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_result_cos-20250915.png b/needles/gnome/apps/calculator/calc_result_cos-20250915.png new file mode 100644 index 00000000..e8df66d8 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_result_cos-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_result_median-20250915.json b/needles/gnome/apps/calculator/calc_result_median-20250915.json new file mode 100644 index 00000000..4427b312 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_result_median-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 339, + "ypos": 388, + "width": 19, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_result_median" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_result_median-20250915.png b/needles/gnome/apps/calculator/calc_result_median-20250915.png new file mode 100644 index 00000000..6c39b45f Binary files /dev/null and b/needles/gnome/apps/calculator/calc_result_median-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_result_ones-20250915.json b/needles/gnome/apps/calculator/calc_result_ones-20250915.json new file mode 100644 index 00000000..b4783979 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_result_ones-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 343, + "ypos": 383, + "width": 198, + "height": 36, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_result_ones" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_result_ones-20250915.png b/needles/gnome/apps/calculator/calc_result_ones-20250915.png new file mode 100644 index 00000000..8ed8495d Binary files /dev/null and b/needles/gnome/apps/calculator/calc_result_ones-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_result_arg-20250718.json b/needles/gnome/apps/calculator/calc_result_re-20250915.json similarity index 53% rename from needles/gnome/apps/calculator/calc_result_arg-20250718.json rename to needles/gnome/apps/calculator/calc_result_re-20250915.json index ae58f0be..c95b989e 100644 --- a/needles/gnome/apps/calculator/calc_result_arg-20250718.json +++ b/needles/gnome/apps/calculator/calc_result_re-20250915.json @@ -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" ] } \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_result_re-20250915.png b/needles/gnome/apps/calculator/calc_result_re-20250915.png new file mode 100644 index 00000000..73d59be2 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_result_re-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_result_round-20250915.json b/needles/gnome/apps/calculator/calc_result_round-20250915.json new file mode 100644 index 00000000..17feef61 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_result_round-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 340, + "ypos": 387, + "width": 20, + "height": 28, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_result_round" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_result_round-20250915.png b/needles/gnome/apps/calculator/calc_result_round-20250915.png new file mode 100644 index 00000000..982684cb Binary files /dev/null and b/needles/gnome/apps/calculator/calc_result_round-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_select_function_cos-20250915.json b/needles/gnome/apps/calculator/calc_select_function_cos-20250915.json new file mode 100644 index 00000000..86231a10 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_select_function_cos-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 468, + "ypos": 380, + "width": 54, + "height": 22, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_select_function_cos" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_cos-20250915.png b/needles/gnome/apps/calculator/calc_select_function_cos-20250915.png new file mode 100644 index 00000000..fcea86d7 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_cos-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_select_function_median-20250915.json b/needles/gnome/apps/calculator/calc_select_function_median-20250915.json new file mode 100644 index 00000000..3068ea53 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_select_function_median-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 470, + "ypos": 442, + "width": 59, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_select_function_median" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_median-20250915.png b/needles/gnome/apps/calculator/calc_select_function_median-20250915.png new file mode 100644 index 00000000..9a29ce04 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_median-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_select_function_ones-20250915.json b/needles/gnome/apps/calculator/calc_select_function_ones-20250915.json new file mode 100644 index 00000000..0fd8613b --- /dev/null +++ b/needles/gnome/apps/calculator/calc_select_function_ones-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 469, + "ypos": 475, + "width": 61, + "height": 27, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_select_function_ones" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_ones-20250915.png b/needles/gnome/apps/calculator/calc_select_function_ones-20250915.png new file mode 100644 index 00000000..64d2e11a Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_ones-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_select_function_re-20250915.json b/needles/gnome/apps/calculator/calc_select_function_re-20250915.json new file mode 100644 index 00000000..b685b750 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_select_function_re-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 469, + "ypos": 575, + "width": 41, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_select_function_re" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_re-20250915.png b/needles/gnome/apps/calculator/calc_select_function_re-20250915.png new file mode 100644 index 00000000..47c4f24a Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_re-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_select_function_round-20250915.json b/needles/gnome/apps/calculator/calc_select_function_round-20250915.json new file mode 100644 index 00000000..186f98a3 --- /dev/null +++ b/needles/gnome/apps/calculator/calc_select_function_round-20250915.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 468, + "ypos": 476, + "width": 70, + "height": 25, + "type": "match" + } + ], + "properties": [], + "tags": [ + "calc_select_function_round" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_round-20250915.png b/needles/gnome/apps/calculator/calc_select_function_round-20250915.png new file mode 100644 index 00000000..85a56aa7 Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_round-20250915.png differ diff --git a/needles/gnome/apps/calculator/calc_function_sqrt-20250718.json b/needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.json similarity index 51% rename from needles/gnome/apps/calculator/calc_function_sqrt-20250718.json rename to needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.json index 1d3a3ea3..f461bc88 100644 --- a/needles/gnome/apps/calculator/calc_function_sqrt-20250718.json +++ b/needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.json @@ -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" ] } \ No newline at end of file diff --git a/needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.png b/needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.png new file mode 100644 index 00000000..6a2adbff Binary files /dev/null and b/needles/gnome/apps/calculator/calc_select_function_sqrt-20250915.png differ diff --git a/tests/applications/calculator/functions.pm b/tests/applications/calculator/functions.pm index 4c92e4d0..463fe336 100644 --- a/tests/applications/calculator/functions.pm +++ b/tests/applications/calculator/functions.pm @@ -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 {