Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webui tests more robust going back #50

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions test/check-storage
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,7 @@ class TestStorage(anacondalib.VirtInstallMachineCase, StorageHelpers):
# Go back to the Disk Configuration page and re-enter the review screen.
# This should create again a new partitioning object and apply it
# no matter how many partitioning objects were created before
i.back()
i.back()
i.reach_on_sidebar(i.steps.DISK_ENCRYPTION)
i.reach(i.steps.REVIEW)
new_applied_partitioning = s.dbus_get_applied_partitioning()
new_created_partitioning = s.dbus_get_created_partitioning()
Expand Down Expand Up @@ -376,6 +375,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, StorageHelpers)
s = Storage(b, m)
r = Review(b)


disk = "/dev/vda"
dev = "vda"
btrfsname = "btrfstest"
Expand Down Expand Up @@ -428,9 +428,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, StorageHelpers)
applied_partitioning = s.dbus_get_applied_partitioning()

# When adding a new partition a new partitioning should be created
i.back()
i.back(previous_page=i.steps.CUSTOM_MOUNT_POINT)
i.back()
i.reach_on_sidebar(i.steps.INSTALLATION_METHOD)

m.execute(f"sgdisk --new=0:0:0 {disk}")
s.rescan_disks()
Expand Down Expand Up @@ -800,9 +798,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, StorageHelpers)
r.check_disk_row(dev, 3, "home, 15.0 GB: mount, /home")
r.check_disk_row_not_present(dev, f"unused")

i.back()
i.back(previous_page=i.steps.CUSTOM_MOUNT_POINT)
i.back()
i.reach_on_sidebar(i.steps.INSTALLATION_METHOD)

# Checks for nested btrfs subvolume
tmp_mount = "/tmp/btrfs-mount-test"
Expand Down Expand Up @@ -964,8 +960,7 @@ class TestStorageMountPoints(anacondalib.VirtInstallMachineCase, StorageHelpers)
r.check_disk_row(disk, 3, f"{vgname}-home, 8.12 GB: mount, /home")
r.check_disk_row(disk, 4, f"{vgname}-swap, 902 MB: mount, swap")

i.back()
i.back(previous_page=i.steps.CUSTOM_MOUNT_POINT)
i.reach_on_sidebar(i.steps.CUSTOM_MOUNT_POINT)

# remove the /home row and check that row 3 is now swap
s.remove_mountpoint_row(3)
Expand Down
11 changes: 11 additions & 0 deletions test/helpers/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class InstallerSteps(UserDict):
_steps_jump[REVIEW] = PROGRESS
_steps_jump[PROGRESS] = []

_parent_steps = {}
_parent_steps[DISK_ENCRYPTION] = DISK_CONFIGURATION
_parent_steps[CUSTOM_MOUNT_POINT] = DISK_CONFIGURATION

_steps_callbacks = {}
_steps_callbacks[ACCOUNTS] = create_user

Expand Down Expand Up @@ -138,6 +142,13 @@ def click_step_on_sidebar(self, step=None):
step = step or self.get_current_page()
self.browser.click(f"#{step}")

@log_step()
def reach_on_sidebar(self, target_page):
if target_page in self.steps._parent_steps:
self.click_step_on_sidebar(self.steps._parent_steps[target_page])
self.click_step_on_sidebar(target_page)
self.wait_current_page(target_page)

def get_current_page(self):
return self.browser.eval_js('window.location.hash;').replace('#/', '') or self.steps[0]

Expand Down