Skip to content

Commit

Permalink
Merge pull request #430 from KKoukiou/test-shrink-slider
Browse files Browse the repository at this point in the history
test: stop making assumptions about the partition sizes of installed images
  • Loading branch information
KKoukiou committed Sep 5, 2024
2 parents 5227f94 + bc55dd8 commit bcf4fdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions test/check-existing-system
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class TestFedoraPlansUseFreeSpace(VirtInstallMachineCase):
s.reclaim_set_checkbox(True)
i.next(True)

s.reclaim_shrink_device("vda1", "5", "10.6", rowIndex=3)
s.reclaim_shrink_device("vda1", "5", rowIndex=3)
s.reclaim_modal_submit()

i.reach(i.steps.REVIEW)
Expand Down Expand Up @@ -194,11 +194,12 @@ class TestExistingSystemUbuntu(VirtInstallMachineCase):
s.reclaim_set_checkbox(True)
i.next(True)

s.reclaim_shrink_device("vda1", "7", "11.3", rowIndex=3)
s.reclaim_shrink_device("vda1", "7", rowIndex=3)
s.reclaim_modal_submit()

i.reach(i.steps.REVIEW)
r.check_disk_row("vda", parent="vda1", size="7.00 GB", action="resized from 11.3 GB")
# Don't specify the exact original size as this might change with image refreshes
r.check_disk_row("vda", parent="vda1", size="7.00 GB", action="resized from")
r.check_resized_system("Ubuntu", ["vda1"])


Expand Down
5 changes: 3 additions & 2 deletions test/helpers/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,15 @@ def reclaim_modal_submit_and_check_warning(self, warning):
self.browser.click("button:contains('Reclaim space')")
self.browser.wait_in_text("#reclaim-space-modal .pf-v5-c-alert", warning)

def reclaim_shrink_device(self, device, new_size, current_size, rowIndex=None):
def reclaim_shrink_device(self, device, new_size, current_size=None, rowIndex=None):
self.browser.click(
"#reclaim-space-modal-table "
f"tbody{'' if rowIndex is None else f':nth-child({rowIndex})'} "
f"tr:contains('{device}') button[aria-label='shrink']"
)
self.browser.wait_visible("#popover-reclaim-space-modal-shrink-body")
self.browser.wait_val("#reclaim-space-modal-shrink-slider input", current_size)
if current_size is not None:
self.browser.wait_val("#reclaim-space-modal-shrink-slider input", current_size)
# HACK: there is some race here which steals the focus from the input and selects the page text instead
for _ in range(3):
self.browser.focus('#reclaim-space-modal-shrink-slider input')
Expand Down

0 comments on commit bcf4fdf

Please sign in to comment.