So I've inherited a bit of code for squish and really have no guidance towards the program at all besides what I can scrounge up online, so this might be a simple problem...
I have a function, delete_fixture, which is shown here and refers to the activateMenuItem function, shown afterward... What happens is the edit menu gets clicked, but it doesn't seem to click anything else and no popup about deletion comes up, which is what the test is for. I was just wondering if anyone could see any glaring error in this or if I could get some guidance
def delete_fixture(name, confirm=True):
click_data_tab("Fixtures")
click_fixture(name)
activateMenuItem("Edit", "Delete")
if confirm:
mouseClick(waitForObject("{text='OK' type='QPushButton' visible='1'}"))
else:
mouseClick(waitForObject("{text='Cancel' type='QPushButton' visible='1'}"))
def activateMenuItem(*menuPath):
snooze(1)
menu = "{type='QMenuBar' visible='true'}"
parent = "{name='MainWindow' type='MainWindow'}"
try:
waitForObject(parent)
for item in menuPath[:-1]:
activateItem(waitForObjectItem(menu, item))
menu = "{title='%s' type='QMenu' visible='1' window=%s}" % (item, parent)
parent = menu
activateItem(waitForObjectItem(menu, menuPath[-1]))
except LookupError as e:
test.log("Unable to find main window: %s" % HOST_NAME)
raise LookupError("%s -- %s" % (HOST_NAME,e))