Replace mouse actions with keypresses

This commit is contained in:
Al Bowles 2021-10-10 20:28:23 -05:00
parent 7c215d29be
commit 196502b7a0
26 changed files with 145 additions and 106 deletions

View File

@ -190,20 +190,24 @@ sub custom_add_partition {
); );
$args{devicetype} = "raid" if $args{raid1}; $args{devicetype} = "raid" if $args{raid1};
assert_and_click "anaconda_custom_part_add"; # send tab until 'add' button is selected, then press
# the number of tabs needed seems to depend on whether a partition has already been added
if ($args{mountpoint}) { send_key_until_needlematch("anaconda_custom_part_add", "tab");
assert_and_click "anaconda_custom_mountpoint"; send_key "spc";
type_safely $args{mountpoint}; assert_screen "anaconda_custom_mountpoint";
# esc to dismiss the dropdown that appears when we add a mountpoint type_safely $args{mountpoint};
send_key "esc"; send_key "tab";
} send_key "tab";
send_key "tab";
assert_screen "anaconda_custom_size";
# if size is not provided, leave empty to use the remaining disk space
if ($args{size}) { if ($args{size}) {
assert_and_click "anaconda_custom_size";
# size input can contain whole set of different values, so we can't match it with needle
type_safely $args{size}; type_safely $args{size};
} }
assert_and_click "anaconda_custom_btn_add_mountpoint"; send_key "tab";
send_key "tab";
assert_screen "anaconda_custom_btn_add_mountpoint";
send_key "spc";
# if ($args{raid1}) { # if ($args{raid1}) {
# # for RAID1, two disks should be selected # # for RAID1, two disks should be selected
@ -219,15 +223,17 @@ sub custom_add_partition {
# if no devicetype was specified or devicetype is already selected, do nothing # if no devicetype was specified or devicetype is already selected, do nothing
if (($args{devicetype} && !check_screen("anaconda_custom_part_fs_$args{devicetype}_selected", 5))) { if (($args{devicetype} && !check_screen("anaconda_custom_part_fs_$args{devicetype}_selected", 5))) {
assert_and_click "anaconda_custom_part_devicetype"; send_key_until_needlematch("anaconda_custom_part_devicetype_selected", "tab");
# move mouse to dehighlight the list send_key "spc";
mouse_set(10, 100); send_key_until_needlematch("anaconda_custom_part_devicetype_$args{devicetype}", "down");
assert_and_click "anaconda_custom_part_devicetype_$args{devicetype}"; send_key "spc";
} }
# if no filesystem was specified or filesystem is already selected, do nothing # if no filesystem was specified or filesystem is already selected, do nothing
if ($args{filesystem} && !check_screen("anaconda_custom_part_fs_$args{filesystem}_selected", 5)) { if ($args{filesystem} && !check_screen("anaconda_custom_part_fs_$args{filesystem}_selected", 5)) {
assert_and_click "anaconda_custom_part_fs"; send_key_until_needlematch("anaconda_custom_part_fs_selected", "tab");
assert_and_click "anaconda_custom_part_fs_$args{filesystem}"; send_key "spc";
send_key_until_needlematch("anaconda_custom_part_fs_$args{filesystem}_selected", "down");
send_key "spc";
} }
# select "free space" in custom-gui if it exists, so we could run this function again to add another partition # select "free space" in custom-gui if it exists, so we could run this function again to add another partition
if (check_screen("anaconda_custom_free_space", 15)) { if (check_screen("anaconda_custom_free_space", 15)) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 33,
"ypos": 617,
"width": 38,
"height": 34,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"anaconda_custom_part_add"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -1,21 +1,21 @@
{ {
"area": [ "area": [
{ {
"height": 34, "height": 34,
"ypos": 263, "ypos": 263,
"type": "match", "type": "match",
"width": 168, "width": 168,
"xpos": 497, "xpos": 497,
"click_point": { "click_point": {
"xpos": 118, "xpos": 118,
"ypos": 34 "ypos": 34
} }
} }
], ],
"properties": [], "properties": [],
"tags": [ "tags": [
"ENV-DISTRI-rocky", "ENV-DISTRI-rocky",
"LANGUAGE-english", "LANGUAGE-english",
"anaconda_custom_part_devicetype" "anaconda_custom_part_devicetype"
] ]
} }

View File

@ -1,17 +1,17 @@
{ {
"area": [ "area": [
{ {
"xpos": 508, "xpos": 509,
"ypos": 299, "ypos": 300,
"width": 50, "width": 48,
"height": 14, "height": 13,
"type": "match" "type": "match"
} }
], ],
"properties": [], "properties": [],
"tags": [ "tags": [
"ENV-DISTRI-rocky", "ENV-DISTRI-rocky",
"LANGUAGE-english", "LANGUAGE-english",
"anaconda_custom_part_devicetype_lvmlv" "anaconda_custom_part_devicetype_lvmlv"
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 503,
"ypos": 269,
"width": 76,
"height": 27,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -1,21 +0,0 @@
{
"area": [
{
"type": "match",
"width": 114,
"height": 30,
"click_point": {
"xpos": 91.5,
"ypos": 30
},
"xpos": 494,
"ypos": 327
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1,17 +0,0 @@
{
"area": [
{
"xpos": 494,
"ypos": 347,
"width": 140,
"height": 34,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_efi_filesystem"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@ -1,17 +1,17 @@
{ {
"area": [ "area": [
{ {
"ypos": 622, "height": 26,
"width": 30,
"xpos": 36,
"type": "match", "type": "match",
"height": 26 "ypos": 351,
"width": 71,
"xpos": 504
} }
], ],
"properties": [], "properties": [],
"tags": [ "tags": [
"ENV-DISTRI-rocky", "ENV-DISTRI-rocky",
"LANGUAGE-english", "LANGUAGE-english",
"anaconda_custom_part_add" "anaconda_custom_part_fs_selected"
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,21 @@
{
"area": [
{
"ypos": 404,
"type": "match",
"xpos": 352,
"width": 112,
"height": 24,
"click_point": {
"xpos": 134,
"ypos": 10
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_size"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -2,9 +2,9 @@
"area": [ "area": [
{ {
"xpos": 507, "xpos": 507,
"ypos": 271, "ypos": 359,
"width": 29, "width": 120,
"height": 17, "height": 15,
"type": "match" "type": "match"
} }
], ],
@ -12,6 +12,6 @@
"tags": [ "tags": [
"ENV-DISTRI-rocky", "ENV-DISTRI-rocky",
"LANGUAGE-english", "LANGUAGE-english",
"anaconda_custom_part_fs_ext4" "anaconda_custom_part_fs_efi_filesystem_selected"
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,10 +1,10 @@
{ {
"area": [ "area": [
{ {
"xpos": 504, "xpos": 509,
"ypos": 360, "ypos": 275,
"width": 49, "width": 36,
"height": 18, "height": 10,
"type": "match" "type": "match"
} }
], ],
@ -12,6 +12,6 @@
"tags": [ "tags": [
"ENV-DISTRI-rocky", "ENV-DISTRI-rocky",
"LANGUAGE-english", "LANGUAGE-english",
"anaconda_custom_part_fs_swap" "anaconda_custom_part_fs_ext4_selected"
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 506,
"ypos": 364,
"width": 45,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_swap_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB