Skip to content

Commit

Permalink
webui: fix tests for keeping selection after rescan
Browse files Browse the repository at this point in the history
  • Loading branch information
rvykydal committed Sep 1, 2023
1 parent 16b370f commit 09cfdbd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ui/webui/test/check-storage
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class TestStorageExtraDisks(anacondalib.VirtInstallMachineCase, StorageHelpers):
s.check_single_disk_destination("vda")

s.rescan_disks()

s.check_disk_visible("vda")
s.check_disk_visible(dev)

Expand All @@ -297,12 +298,15 @@ class TestStorageExtraDisks(anacondalib.VirtInstallMachineCase, StorageHelpers):

s.rescan_disks()

s.check_disk_selected("vda", True)
s.check_disk_selected(dev, False)

s.select_disk(dev)

# Check that disk selection is kept on Next and Back
for disk in disks:
s.select_disk(disk)
i.next()
i.back()
for disk in disks:
for disk in ["vda", dev]:
s.check_disk_selected(disk)

class TestUtils():
Expand Down Expand Up @@ -554,6 +558,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, TestUtils):
# Select first only vdb disk and verify that the partitioning request is correct
i.open()
i.next()

s.rescan_disks()

self.select_mountpoint(b, i, s, [(dev1, False), (dev2, True)])
Expand Down
4 changes: 3 additions & 1 deletion ui/webui/test/helpers/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def check_disk_selected(self, disk, selected=True):

def get_disk_selected(self, disk):
return (
self.browser.is_present(f"#{id_prefix}-selector-form li.pf-v5-c-chip-group__list-item:contains({disk})") or (disk in self.browser.text(f"#{id_prefix}-target-disk"))
self.browser.is_present(f"#{id_prefix}-selector-form li.pf-v5-c-chip-group__list-item:contains({disk})") or
(self.browser.is_present(f"#{id_prefix}-target-disk") and
disk in self.browser.text(f"#{id_prefix}-target-disk"))
);

@log_step()
Expand Down

0 comments on commit 09cfdbd

Please sign in to comment.