Replace mouse actions with keypresses

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

View File

@ -190,20 +190,24 @@ sub custom_add_partition {
);
$args{devicetype} = "raid" if $args{raid1};
assert_and_click "anaconda_custom_part_add";
if ($args{mountpoint}) {
assert_and_click "anaconda_custom_mountpoint";
type_safely $args{mountpoint};
# esc to dismiss the dropdown that appears when we add a mountpoint
send_key "esc";
}
# 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
send_key_until_needlematch("anaconda_custom_part_add", "tab");
send_key "spc";
assert_screen "anaconda_custom_mountpoint";
type_safely $args{mountpoint};
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}) {
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};
}
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}) {
# # 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 (($args{devicetype} && !check_screen("anaconda_custom_part_fs_$args{devicetype}_selected", 5))) {
assert_and_click "anaconda_custom_part_devicetype";
# move mouse to dehighlight the list
mouse_set(10, 100);
assert_and_click "anaconda_custom_part_devicetype_$args{devicetype}";
send_key_until_needlematch("anaconda_custom_part_devicetype_selected", "tab");
send_key "spc";
send_key_until_needlematch("anaconda_custom_part_devicetype_$args{devicetype}", "down");
send_key "spc";
}
# 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)) {
assert_and_click "anaconda_custom_part_fs";
assert_and_click "anaconda_custom_part_fs_$args{filesystem}";
send_key_until_needlematch("anaconda_custom_part_fs_selected", "tab");
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
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": [
{
"height": 34,
"ypos": 263,
"type": "match",
"width": 168,
"xpos": 497,
"click_point": {
"xpos": 118,
"ypos": 34
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype"
]
{
"area": [
{
"height": 34,
"ypos": 263,
"type": "match",
"width": 168,
"xpos": 497,
"click_point": {
"xpos": 118,
"ypos": 34
}
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype"
]
}

View File

@ -1,17 +1,17 @@
{
"area": [
{
"xpos": 508,
"ypos": 299,
"width": 50,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_devicetype_lvmlv"
]
}
{
"area": [
{
"xpos": 509,
"ypos": 300,
"width": 48,
"height": 13,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"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": [
{
"ypos": 622,
"width": 30,
"xpos": 36,
"height": 26,
"type": "match",
"height": 26
"ypos": 351,
"width": 71,
"xpos": 504
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_add"
"anaconda_custom_part_fs_selected"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -1,17 +0,0 @@
{
"area": [
{
"xpos": 504,
"ypos": 360,
"width": 49,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"anaconda_custom_part_fs_swap"
]
}

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": [
{
"xpos": 507,
"ypos": 271,
"width": 29,
"height": 17,
"ypos": 359,
"width": 120,
"height": 15,
"type": "match"
}
],
@ -12,6 +12,6 @@
"tags": [
"ENV-DISTRI-rocky",
"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

@ -0,0 +1,17 @@
{
"area": [
{
"xpos": 509,
"ypos": 275,
"width": 36,
"height": 10,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-english",
"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