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)
|
||||
except:
|
||||
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
|
||||
if platform.system() == "Darwin":
|
||||
if menu == "Tools" and item == "Options...":
|
||||
#nativeType("<Command+,>")
|
||||
# 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
|
||||
# Use Locator for menu items which wouldn't work on macOS
|
||||
if menu == "Tools" and item == "Options..." or menu == "File" and item == "Exit":
|
||||
selectFromLocator("t %s" % item, item)
|
||||
return
|
||||
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
|
||||
snooze(1)
|
||||
waitFor("menuObject.visible", 1000)
|
||||
|
@@ -50,21 +50,10 @@ def main():
|
||||
overrideStartApplication()
|
||||
startApplication("qtcreator" + SettingsPath)
|
||||
try:
|
||||
if platform.system() == 'Darwin':
|
||||
try:
|
||||
fileMenu = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar",
|
||||
testData.field(lang, "File"))
|
||||
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)
|
||||
# Use Locator for menu items which wouldn't work on macOS
|
||||
exitCommand = testData.field(lang, "Exit")
|
||||
selectFromLocator("t %s" % exitCommand.rstrip("(X)"), exitCommand)
|
||||
test.passes("Creator was running in %s translation." % languageName)
|
||||
except:
|
||||
test.fail("Creator seems to be missing %s translation" % languageName)
|
||||
sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow")
|
||||
|
@@ -1,12 +1,12 @@
|
||||
"language" "File" "Exit" "ISO"
|
||||
"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ"
|
||||
"Danish (Denmark)" "Fil" "Afslut" "da_DK"
|
||||
"German (Germany)" "Datei" "Beenden" "de_DE"
|
||||
"French (France)" "Fichier" "Quitter" "fr_FR"
|
||||
"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP"
|
||||
"Polish (Poland)" "Plik" "Zakończ" "pl_PL"
|
||||
"Russian (%1)" "Файл" "Выход" "ru_RU"
|
||||
"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL"
|
||||
"Ukrainian (Ukraine)" "Файл" "Вийти" "uk_UA"
|
||||
"Chinese (China)" "文件(F)" "退出(X)" "zh_CN"
|
||||
"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW"
|
||||
"language" "Exit" "ISO"
|
||||
"Czech (CzechRepublic)" "Ukončit" "cs_CZ"
|
||||
"Danish (Denmark)" "Afslut" "da_DK"
|
||||
"German (Germany)" "Beenden" "de_DE"
|
||||
"French (France)" "Quitter" "fr_FR"
|
||||
"Japanese (Japan)" "終了(X)" "ja_JP"
|
||||
"Polish (Poland)" "Zakończ" "pl_PL"
|
||||
"Russian (%1)" "Выход" "ru_RU"
|
||||
"Slovenian (Slovenia)" "Končaj" "sl_SL"
|
||||
"Ukrainian (Ukraine)" "Вийти" "uk_UA"
|
||||
"Chinese (China)" "退出(X)" "zh_CN"
|
||||
"Chinese (Taiwan)" "離開(X)" "zh_TW"
|
||||
|
|
Reference in New Issue
Block a user