mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
uitests: More usage of storagebrowser helper
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
73b61ffbc9
commit
3f59d9de84
@ -556,6 +556,7 @@ class AddHardware(uiutils.UITestCase):
|
||||
source = tab.find("Source path:", "text")
|
||||
source.text = "/foo/source"
|
||||
tab.find("Browse...", "push button").click()
|
||||
# Specific testing for dir vol handling for filesystem browse
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find_fuzzy("default-pool", "table cell").click()
|
||||
browsewin.find_fuzzy("bochs-vol", "table cell").click()
|
||||
|
@ -157,13 +157,9 @@ class NewVM(uiutils.UITestCase):
|
||||
|
||||
# Select a fake iso
|
||||
newvm.find_fuzzy("install-iso-browse", "button").click()
|
||||
browser = self.app.root.find("vmm-storage-browser")
|
||||
browser.find_fuzzy("default-pool", "table cell").click()
|
||||
browser.find_fuzzy("iso-vol", "table cell").click()
|
||||
browser.find_fuzzy("Choose Volume", "button").click()
|
||||
self._select_storagebrowser_volume("default-pool", "iso-vol")
|
||||
|
||||
osentry = newvm.find("oslist-entry")
|
||||
uiutils.check(lambda: browser.showing is False)
|
||||
uiutils.check(lambda: osentry.text == "None detected")
|
||||
|
||||
# Change distro to win8
|
||||
@ -659,8 +655,8 @@ class NewVM(uiutils.UITestCase):
|
||||
# Verify default disk storage was actually created. This has some
|
||||
# special handling in domain.py
|
||||
tab.find("Browse", "push button").click()
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find("%s.qcow2" % vmname, "table cell")
|
||||
browser = self.app.root.find("vmm-storage-browser")
|
||||
browser.find("%s.qcow2" % vmname, "table cell")
|
||||
|
||||
|
||||
def testNewVMRemote(self):
|
||||
@ -707,10 +703,7 @@ class NewVM(uiutils.UITestCase):
|
||||
uiutils.check(lambda: not browsewin.active)
|
||||
# Reopen, select storage
|
||||
newvm.find("install-import-browse").click()
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find_fuzzy("default-pool", "table cell").click()
|
||||
browsewin.find_fuzzy("bochs-vol", "table cell").click()
|
||||
browsewin.find("Choose Volume").click()
|
||||
self._select_storagebrowser_volume("default-pool", "bochs-vol")
|
||||
uiutils.check(
|
||||
lambda: importtext.text == "/dev/default-pool/bochs-vol")
|
||||
|
||||
|
@ -87,9 +87,8 @@ class CreateVol(uiutils.UITestCase):
|
||||
chooser = self.app.root.find(
|
||||
"Locate existing storage", "file chooser")
|
||||
chooser.keyCombo("<alt>F4")
|
||||
browsewin.find_fuzzy("default-pool", "table cell").click()
|
||||
browsewin.find("bochs-vol", "table cell").doubleClick()
|
||||
uiutils.check(lambda: not browsewin.active)
|
||||
self._select_storagebrowser_volume(
|
||||
"default-pool", "bochs-vol", doubleclick=True)
|
||||
backingstore = win.find("backing-store")
|
||||
uiutils.check(lambda: "bochs-vol" in backingstore.text)
|
||||
finish.click()
|
||||
@ -131,10 +130,7 @@ class CreateVol(uiutils.UITestCase):
|
||||
name.text = newname
|
||||
win.find("Backing store").click_expander()
|
||||
win.find("Browse...").click()
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find_fuzzy("disk-pool", "table cell").click()
|
||||
browsewin.find("diskvol7", "table cell").click()
|
||||
browsewin.find("Choose Volume").click()
|
||||
self._select_storagebrowser_volume("disk-pool", "diskvol7")
|
||||
finish.click()
|
||||
vollist.find(newname)
|
||||
|
||||
|
@ -208,10 +208,7 @@ class Details(uiutils.UITestCase):
|
||||
tab.find_fuzzy("Direct kernel boot", "toggle button").click_expander()
|
||||
tab.find_fuzzy("Enable direct kernel", "check box").click()
|
||||
tab.find("kernel-browse", "push button").click()
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find("default-pool", "table cell").click()
|
||||
browsewin.find("bochs-vol", "table cell").click()
|
||||
browsewin.find("Choose Volume", "push button").click()
|
||||
self._select_storagebrowser_volume("default-pool", "bochs-vol")
|
||||
uiutils.check(lambda: win.active)
|
||||
kernelpath = tab.find("Kernel path:", "text")
|
||||
uiutils.check(lambda: "bochs" in kernelpath.text)
|
||||
|
@ -60,10 +60,7 @@ class MediaChange(uiutils.UITestCase):
|
||||
combo.find(r"Fedora12_media \(/dev/sr0\)")
|
||||
entry.click()
|
||||
tab.find("Browse", "push button").click()
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find_fuzzy("default-pool", "table cell").click()
|
||||
browsewin.find_fuzzy("backingl1.img", "table cell").click()
|
||||
browsewin.find("Choose Volume", "push button").click()
|
||||
self._select_storagebrowser_volume("default-pool", "backingl1.img")
|
||||
appl.click()
|
||||
# Check 'already in use' dialog
|
||||
self._click_alert_button("already in use by", "Yes")
|
||||
|
@ -103,11 +103,16 @@ class UITestCase(unittest.TestCase):
|
||||
alert.find(button_text, "push button").click()
|
||||
check(lambda: not alert.active)
|
||||
|
||||
def _select_storagebrowser_volume(self, pool, vol):
|
||||
def _select_storagebrowser_volume(self, pool, vol, doubleclick=False):
|
||||
browsewin = self.app.root.find("vmm-storage-browser")
|
||||
browsewin.find_fuzzy(pool, "table cell").click()
|
||||
browsewin.find_fuzzy(vol, "table cell").click()
|
||||
browsewin.find_fuzzy("Choose Volume").click()
|
||||
volcell = browsewin.find_fuzzy(vol, "table cell")
|
||||
if doubleclick:
|
||||
volcell.doubleClick()
|
||||
else:
|
||||
volcell.click()
|
||||
browsewin.find_fuzzy("Choose Volume").click()
|
||||
check(lambda: not browsewin.active)
|
||||
|
||||
def _walkUIList(self, win, lst, error_cb, reverse=False):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user