Skip to content

Commit

Permalink
tests: add some pixel tests for reclaim dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou committed Aug 16, 2024
1 parent 81816a1 commit d5b336d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
45 changes: 43 additions & 2 deletions test/check-storage-reclaim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from anacondalib import VirtInstallMachineCase
from installer import Installer
from operating_systems import WindowsOS
from review import Review
from storage import Storage
from storagelib import StorageCase
Expand All @@ -27,7 +28,7 @@ from testlib import (


@nondestructive
class TestStorageUseFreeSpaceScenario(VirtInstallMachineCase, StorageCase):
class TestReclaim(VirtInstallMachineCase, StorageCase):
def setup_partitions(self, s, i):
disk = "/dev/vda"
btrfsname = "btrfstest"
Expand Down Expand Up @@ -236,13 +237,19 @@ class TestReclaimLUKS(VirtInstallMachineCase, StorageCase):
s.set_partitioning("use-free-space")
s.reclaim_set_checkbox(True)
i.next(True)

b.assert_pixels(
"#reclaim-space-modal",
"reclaim-space-modal-encrypted",
)

s.reclaim_check_device_row("vda1", "", "luks", "4.29 GB", locked=True)
s.reclaim_check_action_button_present("vda1", "shrink", True, True)
s.reclaim_check_action_button_present("vda1", "delete", True)


@nondestructive
class TestStorageUseFreeSpaceScenarioExistingSystemFedora(VirtInstallMachineCase, StorageCase):
class TestReclaimExistingSystemFedora(VirtInstallMachineCase, StorageCase):
disk_image = "fedora-rawhide"

def testDeletePartition(self):
Expand All @@ -257,6 +264,13 @@ class TestStorageUseFreeSpaceScenarioExistingSystemFedora(VirtInstallMachineCase
s.set_partitioning("use-free-space")
s.reclaim_set_checkbox(True)
i.next(True)

b.assert_pixels(
"#reclaim-space-modal",
"reclaim-space-modal-fedora",
ignore=["td[data-label=Space]"],
)

s.reclaim_remove_device("vda4")
s.reclaim_modal_submit()

Expand All @@ -265,5 +279,32 @@ class TestStorageUseFreeSpaceScenarioExistingSystemFedora(VirtInstallMachineCase
r.check_some_erased_checkbox_label()


@nondestructive
class TestReclaimExistingSystemWindows(VirtInstallMachineCase):
disk_size = 20

def setUp(self):
super().setUp()
WindowsOS(machine=self.machine, browser=self.browser).partition_disk()

def testBasic(self):
b = self.browser
m = self.machine
i = Installer(b, m)
s = Storage(b, m)

i.open()
i.reach(i.steps.INSTALLATION_METHOD)
s.set_partitioning("use-free-space")
s.reclaim_set_checkbox(True)
i.next(True)

b.assert_pixels(
"#reclaim-space-modal",
"reclaim-space-modal-windows",
ignore=["td[data-label=Space]"],
)


if __name__ == '__main__':
test_main()

0 comments on commit d5b336d

Please sign in to comment.