Skip to content

Commit

Permalink
test: drop testRedoUndoCommit
Browse files Browse the repository at this point in the history
The need for this test is dropped in PR #1443
  • Loading branch information
jkozol authored and martinpitt committed Jul 22, 2022
1 parent 0c78e51 commit 3bce930
Showing 1 changed file with 0 additions and 84 deletions.
84 changes: 0 additions & 84 deletions test/verify/check-package
Original file line number Diff line number Diff line change
Expand Up @@ -111,90 +111,6 @@ class TestPackage(composerlib.ComposerCase):
# collect code coverage result
self.check_coverage()

def testRedoUndoCommit(self):
b = self.browser

self.login_and_go("/composer", superuser=True)
b.wait_visible("#main")

# go to edit package page
b.click("li[data-blueprint=openssh-server] a:contains('Edit packages')")
with b.wait_timeout(120):
b.wait_visible("ul[aria-label='Available components'] li:nth-child(1)")

# search for openssh-server pacakge
b.set_input_text("#cmpsr-blueprint-input-filter", "cockpit-bridge", blur=False)
b.key_press("\r")
with b.wait_timeout(120):
b.wait_text("#cockpit-bridge-input", "cockpit-bridge")
# add it to blueprint
b.click("li[data-input=cockpit-bridge] .fa-plus")
# wait for package added
b.wait_visible("li[data-component=cockpit-bridge]")
# + becomes -
b.wait_visible("li[data-input=cockpit-bridge] .fa-minus")
# bordered icon
b.wait_visible("li[data-input=cockpit-bridge] .list-pf-icon-bordered")
# redo button should be disabled
b.wait_attr_contains("button[data-button=redo]", "class", "disabled")

# undo
b.click("button[data-button=undo]")
b.wait_not_present("li[data-component=cockpit-bridge]")
b.wait_attr_contains("button[data-button=undo]", "class", "disabled")
# - becomes +
b.wait_visible("li[data-input=cockpit-bridge] .fa-plus")
# no bordered icon
b.wait_not_present("li[data-input=cockpit-bridge] .list-pf-icon-bordered")

# redo
b.click("button[data-button=redo]")
b.wait_visible("li[data-component=cockpit-bridge]")
# undo button should be disabled
b.wait_attr_contains("button[data-button=redo]", "class", "disabled")

# pending commit
b.click("a:contains('1 Pending Change')")
# show Added cockpit-bridge
b.wait_visible("#cmpsr-modal-pending-changes ul li:nth-child(1) .row:contains('Added')")
b.wait_visible("#cmpsr-modal-pending-changes ul li:nth-child(1) "
".row:contains('cockpit-bridge-*')")
b.click("#cmpsr-modal-pending-changes button:contains('Close')")
b.wait_not_present("#cmpsr-modal-pending-changes")

# logout and login, still in edit blueprint page
with b.wait_timeout(300):
b.relogin("/composer", superuser=True)
b.wait_visible("ul[aria-label='Available components'] li:nth-child(1)")

# "1 Pending Change" still there
b.wait_visible("a:contains('1 Pending Change')")
b.click("#cockpit-bridge-kebab")
b.wait_attr("#cockpit-bridge-kebab", "aria-expanded", "true")
b.click("ul[aria-labelledby=cockpit-bridge-kebab] a:contains('Remove')")
b.wait_not_present("li[data-component=cockpit-bridge]")
# "2 Pending Change" now
b.wait_visible("a:contains('2 Pending Change')")
# commit
b.click("button:contains('Commit')")
b.wait_visible("#cmpsr-modal-pending-changes .form-horizontal p + div ul "
"li:nth-child(1) .row:contains('Removed')")
b.wait_visible("#cmpsr-modal-pending-changes .form-horizontal p + div ul "
"li:nth-child(1) .row:contains('cockpit-bridge-*')")
b.wait_in_text("#cmpsr-modal-pending-changes .form-horizontal p + div + div > strong",
"Changes made in a previous session")
b.wait_visible("#cmpsr-modal-pending-changes .form-horizontal p + div + div ul "
"li:nth-child(1) .row:contains('Added')")
b.wait_visible("#cmpsr-modal-pending-changes .form-horizontal p + div + div ul "
"li:nth-child(1) .row:contains('cockpit-bridge-*')")
b.click("#cmpsr-modal-pending-changes .modal-footer button:contains('Commit')")
b.wait_visible("#alertBlueprintCommitSucceeded")
b.click("#alertBlueprintCommitSucceeded .pf-c-alert__action button")
b.wait_not_present("#alertBlueprintCommitSucceeded")

# collect code coverage result
self.check_coverage()

def testDiscard(self):
b = self.browser

Expand Down

0 comments on commit 3bce930

Please sign in to comment.