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

Revert "test: handle duplicate id's in PF modal dialogs" #1330

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
4 changes: 2 additions & 2 deletions test/check-machines-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class TestMachinesMigration(VirtualMachinesCase):
self.goToVmPage("subVmTest1")

self.performAction("subVmTest1", "migrate")
b.wait_visible("#migrate-modal.pf-v5-c-modal-box")
b.wait_visible("#migrate-modal")

if fail == "uri":
# test failure for syntactically incorrect destination uri
Expand Down Expand Up @@ -192,7 +192,7 @@ class TestMachinesMigration(VirtualMachinesCase):
self.assertIn("subVmTest1", machine1.execute("virsh list --all"))
else:
with b.wait_timeout(120):
b.wait_not_present("#migrate-modal.pf-v5-c-modal-box")
b.wait_not_present("#migrate-modal")

# Verify the state of the migrated VM in the destination host
# The migrated VM should always exist on destination - domstate depends on the options of the dialog set
Expand Down
36 changes: 14 additions & 22 deletions test/check-machines-settings
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,7 @@ class TestMachinesSettings(VirtualMachinesCase):

# Change watchdog
b.click("#vm-subVmTest1-watchdog-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-watchdog-modal")
b.click("#reset")
b.click("#watchdog-dialog-apply")
b.wait_not_present("#vm-subVmTest1-watchdog-modal")
Expand Down Expand Up @@ -510,12 +509,11 @@ class TestMachinesSettings(VirtualMachinesCase):

def openWatchDogDialog():
b.click("#vm-subVmTest1-watchdog-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-watchdog-modal")

def closeWatchDogDialog(selector):
b.click(selector)
b.wait_not_present("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box")
b.wait_not_present("#vm-subVmTest1-watchdog-modal")

def setWatchdogAction(action, machine_has_no_watchdog=False, pixel_test_tag=None, reboot_machine=False):
# If no watchdog action is set, we are attaching a new watchdog device. If watchdog already is set, we are editing an exiting watchdog device
Expand All @@ -527,7 +525,7 @@ class TestMachinesSettings(VirtualMachinesCase):
openWatchDogDialog()

if pixel_test_tag:
b.assert_pixels("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box", pixel_test_tag, skip_layouts=["rtl"])
b.assert_pixels("#vm-subVmTest1-watchdog-modal", pixel_test_tag, skip_layouts=["rtl"])

b.click(f"#{action}")

Expand Down Expand Up @@ -593,11 +591,10 @@ class TestMachinesSettings(VirtualMachinesCase):

def removeWatchdogDevice(live=True):
b.click("#vm-subVmTest1-watchdog-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-watchdog-modal")

b.click("#watchdog-dialog-detach")
b.wait_not_present("#vm-subVmTest1-watchdog-modal.pf-v5-c-modal-box")
b.wait_not_present("#vm-subVmTest1-watchdog-modal")

b.wait_in_text("#vm-subVmTest1-watchdog-state", "none")
# check no watchdog is present in VM's xml (also xmllint is expected to return non-zero code)
Expand Down Expand Up @@ -694,17 +691,15 @@ class TestMachinesSettings(VirtualMachinesCase):

# Watchdog can be attached to a transient VM
b.click("#vm-subVmTest2-watchdog-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest2-watchdog-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest2-watchdog-modal")
b.click("#pause")
b.click("#watchdog-dialog-apply")
b.wait_not_present("#vm-subVmTest2-watchdog-modal")
b.wait_in_text("#vm-subVmTest2-watchdog-state", action_strings["pause"])

# Watchdog of transient VM should not be editable
b.click("#vm-subVmTest2-watchdog-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest2-watchdog-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest2-watchdog-modal")
b.wait_visible("#watchdog-dialog-apply[aria-disabled=true]")
b.mouse("#watchdog-dialog-apply", "mouseenter")
b.wait_visible("#watchdog-live-edit-tooltip")
Expand All @@ -723,11 +718,10 @@ class TestMachinesSettings(VirtualMachinesCase):
b.wait_in_text("#vm-subVmTest1-vsock-button", "edit")

b.click("#vm-subVmTest1-vsock-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-vsock-modal")

if pixel_test_tag:
b.assert_pixels("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box", pixel_test_tag)
b.assert_pixels("#vm-subVmTest1-vsock-modal", pixel_test_tag)

b.set_checked("#vsock-cid-generate", not auto)
if not auto:
Expand All @@ -751,8 +745,7 @@ class TestMachinesSettings(VirtualMachinesCase):

def setVsockLive(new_auto, new_address=None, previous_address=None, previous_auto=None, reboot_machine=False):
b.click("#vm-subVmTest1-vsock-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-vsock-modal")

b.set_checked("#vsock-cid-generate", not new_auto)
if not new_auto:
Expand Down Expand Up @@ -825,11 +818,10 @@ class TestMachinesSettings(VirtualMachinesCase):

def removeVsockDevice(live=True):
b.click("#vm-subVmTest1-vsock-button")
# HACK: PF modal with duplicate id's https://github.com/patternfly/patternfly-react/issues/9399
b.wait_visible("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-vsock-modal")

b.click("#vsock-dialog-detach")
b.wait_not_present("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box")
b.wait_not_present("#vm-subVmTest1-vsock-modal")

b.wait_in_text("#vm-subVmTest1-vsock-address", "none")
# check no vsock is present in VM's xml (also xmllint is expected to return non-zero code)
Expand Down Expand Up @@ -879,7 +871,7 @@ class TestMachinesSettings(VirtualMachinesCase):

# Vsock of transient VM should not be editable
b.click("#vm-subVmTest1-vsock-button")
b.wait_visible("#vm-subVmTest1-vsock-modal.pf-v5-c-modal-box")
b.wait_visible("#vm-subVmTest1-vsock-modal")
b.wait_visible("#vsock-dialog-apply[aria-disabled=true]")
b.mouse("#vsock-dialog-apply", "mouseenter")
b.wait_visible("#vsock-live-edit-tooltip")
Expand Down