2016-01-15 14:55:33 +01:00
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2012-09-18 12:48:40 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
|
2023-06-09 22:28:33 +02:00
|
|
|
|
|
|
|
|
def __waitForListView__():
|
|
|
|
|
listView = waitForObject("{container=':Qt Creator.WelcomeScreenStackedWidget' "
|
2023-10-11 13:11:39 +02:00
|
|
|
"type='QListView' name='AllItemsView' visible='1'}")
|
2023-06-09 22:28:33 +02:00
|
|
|
return listView
|
|
|
|
|
|
|
|
|
|
|
2012-09-18 12:48:40 +02:00
|
|
|
def main():
|
|
|
|
|
# open Qt Creator
|
2018-08-22 14:37:34 +02:00
|
|
|
startQC()
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return
|
2022-02-14 17:03:11 +01:00
|
|
|
wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton('Get Started')
|
2017-02-08 09:34:40 +01:00
|
|
|
if not test.verify(all((wsButtonFrame, wsButtonLabel)),
|
|
|
|
|
"Verifying: Qt Creator displays Welcome Page with Getting Started."):
|
|
|
|
|
test.fatal("Something's wrong - leaving test.")
|
2014-07-24 13:53:12 +02:00
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
|
|
|
|
# select "Tutorials"
|
2018-07-10 13:57:16 +02:00
|
|
|
if not switchToSubMode('Tutorials'):
|
2017-02-08 09:34:40 +01:00
|
|
|
test.fatal("Could not find Tutorials button - leaving test")
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return
|
|
|
|
|
searchTutorials = waitForObject("{type='QLineEdit' placeholderText='Search in Tutorials...'}")
|
|
|
|
|
mouseClick(searchTutorials)
|
|
|
|
|
replaceEditorContent(searchTutorials, "qwerty")
|
2023-06-09 22:28:33 +02:00
|
|
|
listView = __waitForListView__()
|
2022-02-14 17:03:11 +01:00
|
|
|
waitFor('findExampleOrTutorial(listView, ".*") is None', 3000)
|
|
|
|
|
tutorial = findExampleOrTutorial(listView, ".*", True)
|
2017-02-08 09:34:40 +01:00
|
|
|
test.verify(tutorial is None,
|
2012-09-18 12:48:40 +02:00
|
|
|
"Verifying: 'Tutorials' topic is opened and nothing is shown.")
|
2023-10-11 13:11:39 +02:00
|
|
|
bnr = "Building and Running an Example"
|
2017-02-08 09:34:40 +01:00
|
|
|
replaceEditorContent(searchTutorials, bnr.lower())
|
2023-06-09 22:28:33 +02:00
|
|
|
listView = __waitForListView__()
|
2022-02-14 17:03:11 +01:00
|
|
|
waitFor('findExampleOrTutorial(listView, "%s.*") is not None' % bnr, 3000)
|
|
|
|
|
tutorial = findExampleOrTutorial(listView, "%s.*" % bnr, True)
|
2017-02-08 09:34:40 +01:00
|
|
|
test.verify(tutorial is not None, "Verifying: Expected Text tutorial is shown.")
|
2018-11-27 10:50:46 +01:00
|
|
|
# clicking before documentation was updated will open the tutorial in browser
|
|
|
|
|
progressBarWait(warn=False)
|
2012-09-18 12:48:40 +02:00
|
|
|
# select a text tutorial
|
2023-10-11 13:11:39 +02:00
|
|
|
mouseClick(waitForObjectItem(listView, str(tutorial.text)))
|
2014-07-24 13:53:12 +02:00
|
|
|
test.verify("Building and Running an Example" in
|
|
|
|
|
str(waitForObject(":Help Widget_Help::Internal::HelpWidget").windowTitle),
|
|
|
|
|
"Verifying: The tutorial is opened inside Help.")
|
|
|
|
|
# close help widget again to avoid focus issues
|
|
|
|
|
sendEvent("QCloseEvent", waitForObject(":Help Widget_Help::Internal::HelpWidget"))
|
|
|
|
|
# check a demonstration video link
|
2017-02-08 09:34:40 +01:00
|
|
|
mouseClick(searchTutorials)
|
|
|
|
|
replaceEditorContent(searchTutorials, "embedded device")
|
2023-10-11 13:11:39 +02:00
|
|
|
embeddedTutorial = "How to install and set up Qt for Device Creation.*"
|
2023-06-09 22:28:33 +02:00
|
|
|
listView = __waitForListView__()
|
2022-02-14 17:03:11 +01:00
|
|
|
waitFor('findExampleOrTutorial(listView, embeddedTutorial) is not None', 3000)
|
|
|
|
|
tutorial = findExampleOrTutorial(listView, embeddedTutorial, True)
|
2017-02-08 09:34:40 +01:00
|
|
|
test.verify(tutorial is not None,
|
2014-07-24 13:53:12 +02:00
|
|
|
"Verifying: Link to the expected demonstration video exists.")
|
2012-09-18 12:48:40 +02:00
|
|
|
# exit Qt Creator
|
|
|
|
|
invokeMenuItem("File", "Exit")
|