forked from qt-creator/qt-creator
Squish: Use Locator instead of menu hack
Change-Id: I4e84a52fb6ad4c93ef53bb1a17639fd8b263b987 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -176,21 +176,10 @@ def invokeMenuItem(menu, item, *subItems):
|
|||||||
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
|
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
|
||||||
except:
|
except:
|
||||||
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
|
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
|
||||||
# HACK as Squish fails to provide a proper way to access the system menu
|
# Use Locator for menu items which wouldn't work on macOS
|
||||||
if platform.system() == "Darwin":
|
if menu == "Tools" and item == "Options..." or menu == "File" and item == "Exit":
|
||||||
if menu == "Tools" and item == "Options...":
|
selectFromLocator("t %s" % item, item)
|
||||||
#nativeType("<Command+,>")
|
return
|
||||||
# the following is a pure HACK because using the default key sequence seems to be broken
|
|
||||||
# when running from inside Squish
|
|
||||||
menuBar = waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 500)
|
|
||||||
nativeMouseClick(menuBar, 75, 5, 0, Qt.LeftButton)
|
|
||||||
for _ in range(3):
|
|
||||||
nativeType("<Down>")
|
|
||||||
nativeType("<Return>")
|
|
||||||
return
|
|
||||||
if menu == "File" and item == "Exit":
|
|
||||||
nativeType("<Command+q>")
|
|
||||||
return
|
|
||||||
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
|
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
|
||||||
snooze(1)
|
snooze(1)
|
||||||
waitFor("menuObject.visible", 1000)
|
waitFor("menuObject.visible", 1000)
|
||||||
|
@@ -50,21 +50,10 @@ def main():
|
|||||||
overrideStartApplication()
|
overrideStartApplication()
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
try:
|
try:
|
||||||
if platform.system() == 'Darwin':
|
# Use Locator for menu items which wouldn't work on macOS
|
||||||
try:
|
exitCommand = testData.field(lang, "Exit")
|
||||||
fileMenu = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar",
|
selectFromLocator("t %s" % exitCommand.rstrip("(X)"), exitCommand)
|
||||||
testData.field(lang, "File"))
|
test.passes("Creator was running in %s translation." % languageName)
|
||||||
activateItem(fileMenu)
|
|
||||||
obj = waitForObject("{type='QMenu' visible='1'}")
|
|
||||||
test.compare(str(obj.objectName), 'QtCreator.Menu.File',
|
|
||||||
"Creator was running in %s translation" % languageName)
|
|
||||||
activateItem(fileMenu)
|
|
||||||
except:
|
|
||||||
test.fail("Creator seems to be missing %s translation" % languageName)
|
|
||||||
nativeType("<Command+q>")
|
|
||||||
else:
|
|
||||||
invokeMenuItem(testData.field(lang, "File"), testData.field(lang, "Exit"))
|
|
||||||
test.passes("Creator was running in %s translation." % languageName)
|
|
||||||
except:
|
except:
|
||||||
test.fail("Creator seems to be missing %s translation" % languageName)
|
test.fail("Creator seems to be missing %s translation" % languageName)
|
||||||
sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow")
|
sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow")
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
"language" "File" "Exit" "ISO"
|
"language" "Exit" "ISO"
|
||||||
"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ"
|
"Czech (CzechRepublic)" "Ukončit" "cs_CZ"
|
||||||
"Danish (Denmark)" "Fil" "Afslut" "da_DK"
|
"Danish (Denmark)" "Afslut" "da_DK"
|
||||||
"German (Germany)" "Datei" "Beenden" "de_DE"
|
"German (Germany)" "Beenden" "de_DE"
|
||||||
"French (France)" "Fichier" "Quitter" "fr_FR"
|
"French (France)" "Quitter" "fr_FR"
|
||||||
"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP"
|
"Japanese (Japan)" "終了(X)" "ja_JP"
|
||||||
"Polish (Poland)" "Plik" "Zakończ" "pl_PL"
|
"Polish (Poland)" "Zakończ" "pl_PL"
|
||||||
"Russian (%1)" "Файл" "Выход" "ru_RU"
|
"Russian (%1)" "Выход" "ru_RU"
|
||||||
"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL"
|
"Slovenian (Slovenia)" "Končaj" "sl_SL"
|
||||||
"Ukrainian (Ukraine)" "Файл" "Вийти" "uk_UA"
|
"Ukrainian (Ukraine)" "Вийти" "uk_UA"
|
||||||
"Chinese (China)" "文件(F)" "退出(X)" "zh_CN"
|
"Chinese (China)" "退出(X)" "zh_CN"
|
||||||
"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW"
|
"Chinese (Taiwan)" "離開(X)" "zh_TW"
|
||||||
|
|
Reference in New Issue
Block a user