1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-13 02:54:31 +00:00

Create a Calculator test for the Flock talk.

This commit is contained in:
Lukas Ruzicka 2023-07-27 16:58:22 +02:00
parent bf4a8ec454
commit 8dd856e6fc
18 changed files with 185 additions and 10 deletions

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 390,
"ypos": 562,
"width": 18,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_button_add"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 455,
"ypos": 539,
"width": 25,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_button_equals"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 254,
"ypos": 466,
"width": 18,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_button_five"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 181,
"ypos": 416,
"width": 26,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_button_seven"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 162,
"ypos": 285,
"width": 29,
"height": 33,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_result_addition"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 182,
"ypos": 532,
"width": 31,
"height": 34,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_result_complex"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 163,
"ypos": 283,
"width": 40,
"height": 32,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_result_multiplication"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 115,
"ypos": 4,
"width": 93,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"calculator_runs"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 KiB

View File

@ -338,6 +338,17 @@
},
"version": "*"
},
"fedora-Flock-x86_64-*": {
"arch": "x86_64",
"distri": "fedora",
"flavor": "Flock",
"settings": {
"DESKTOP": "gnome",
"LIVE": "1",
"TEST_TARGET": "ISO"
},
"version": "*"
},
"fedora-Workstation-upgrade-x86_64-*": {
"arch": "x86_64",
"distri": "fedora",
@ -545,6 +556,10 @@
"machine": "64bit",
"product": "fedora-Workstation-live-iso-x86_64-*"
},
"fedora-Flock-x86_64-*-64bit": {
"machine": "64bit",
"product": "fedora-Flock-x86_64-*"
},
"fedora-Workstation-upgrade-x86_64-*-64bit": {
"machine": "64bit",
"product": "fedora-Workstation-upgrade-x86_64-*"
@ -1037,19 +1052,12 @@
},
"calculator": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20,
"fedora-Workstation-live-iso-x86_64-*-64bit": 20,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Flock-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL_PATH": "tests/applications/calculator",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
"HDD_1": "workstation.qcow2",
"ENTRYPOINT":"_graphical_wait_login calculator"
}
},
"clocks": {

47
tests/calculator.pm Normal file
View File

@ -0,0 +1,47 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub delete_result {
send_key("esc");
}
sub run {
# Starting the application
send_key("super");
type_string("Calculator", max_interval => 10);
send_key("ret");
assert_screen("calculator_runs");
# Add two numbers using buttons
assert_and_click("calculator_button_five");
assert_and_click("calculator_button_add");
assert_and_click("calculator_button_seven");
assert_and_click("calculator_button_equals");
assert_and_click("calculator_result_addition");
delete_result();
# Multiply two numbers using keyboard
#assert_and_click("calculator_entry_field");
type_string("12*15", max_interval => 10);
send_key("ret");
assert_screen("calculator_result_multiplication");
delete_result();
# Complex calculations using keyboard
send_key("ctrl-alt-k");
send_key("esc");
type_string('((2+3)*10)/(4-2)', max_interval => 10);
send_key("ret");
assert_screen("calculator_result_complex");
}
sub test_flags {
return {fatal => 1};
}
1;