Qt Creator ManualTests QtQuick: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Update: QML errors can appear at compile time or at run time)
 
(44 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Tools::QtCreator::QualityAssurance]]
[[Category:Tools::QtCreator::QualityAssurance]]


= Qt Creator Manual Tests: Qt Quick =
{| class="wikitable"
|+QML Editor
!Test
!Result
!Annotation
|+
|Open Qml files, make them invalid & again valid, check that errors are underlined
|
|
|+
|Indent a big Qml file via "Ctrl-I"
|automated
|
|+
|Hover over elements, properties, expressions
|automated
|
|+
|Rename an ID via context menu
|automated
|
|+
|Trigger Find Usages on an id and property
|automated
|
|}


{background:#009900}. |''. QML Editor |''. Result |''. Annotation |<br />| Open Qml files, make them invalid &amp; again valid, check that errors are underlined | | |<br />| Indent a big Qml file via &quot;Ctrl-I&amp;quot; | automated | |<br />| Hover over elements, properties, expressions | automated | |<br />| Rename an ID via context menu | automated | |<br />| Trigger Find Usages on an id and property | automated | |<br />{background:#009900}. |''. Outline (sidebar) |''. Result |''. Annotation |<br />| Navigate to elements / properties by clicking on the item in the outline | | |<br />| Change qml in text, check that Outline updates | automated: tst_qml_outline | |<br />| Drag&amp;amp;Drop elements around in outline, check that text updates | | |<br />| Check/Uncheck 'Show all Bindings' in the Filter, outline should update accordingly | | |<br />{background:#009900}. |''. Qt Quick Wizards |''. Result |''. Annotation |<br />| Create new &quot;Qt Quick Application&amp;quot; through wizard, run application | automated | |<br />| Create new &quot;Qt Quick UI&amp;quot; through wizard, run application | automated | |<br />| Generate &quot;Qt Quick 1/2 Extension Plugin&amp;quot;, compile | automated | |<br />{background:#009900}. |''. Application Output |''. Result |''. Annotation |<br />| QML errors:<br /># Create a hybrid QML/C++ project (Qt Quick Application). In Projects mode, leave &quot;Shadow build&amp;quot; checked.<br /># Add errors to the qml file.<br /># Save and close the file.<br /># Run this project on the desktop.<br />Are the error messages in Application Output clickable when running the app? Do they open the &quot;right&amp;quot;, file &amp;#40;not in shadow build&amp;amp;#41;? | | |<br />| Deploy &amp; run the project with errors on a device. Is the application output still clickable / opens the right file, line, column? | | |<br />{background:#009900}. |''. Qt Quick Designer |''. Result |''. Annotation |<br />| Open all files in $CREATORDIR/tests/manual/qml/testfiles/testfiles.qmlproject and $CREATORDIR/tests/manual/qml/testfiles_quick2/testfiles_quick2.qmlproject and check whether<br />* previews look sane<br />* the Properties editor works for different item types<br />* changes in the Designer cause correct changes to the QML source | | |<br />| Create &amp; Rename &amp; Delete states | | |<br />| Open project $CREATORDIR/tests/manual/qml/testprojects/plugins/plugins.qmlproject and see whether the Designer treats MyComponent and MyComponent2 correctly | | |<br />| Test whether F1 works | | |<br />{background:#009900}. |''. JavaScript Debugging |''. Result |''. Annotation |<br />| Preparation:<br /># Open demos/declarative/samegame/samegame.qmlproject from Qt4's or qtdeclarative/examples/quick/demos/samegame/samegame.qmlproject from Qt5's repository.<br /># Place a breakpoint at the first line of the startNewGame() function (samegame.js) which contains executable code (i.e. not (only) a comment).<br /># Start debugging app | | |<br />| Check that first breakpoint is hit when clicking on &quot;New game&amp;quot; , and that the breakpoint looses it's 'hour glass' when hit | | |<br />| Step through startNewGame() function. Check Locals and Watchers update (should display 'this', 'column', 'i', 'row'). Also try adding watchers, and change content in locals &amp; watchers. (Needs Qt &gt;= 5.4) | | |<br />| Add breakpoint while debugging QML. Does the breakpoint interrupt the program? | | |<br />| Add breakpoint before starting QML Debugger. Does the breakpoint interrupt the program? | | |<br />| While interrupted in a javascript method (with more than one line), step over. Does it go to the next line? | | |<br />| While interrupted in a javascript method that calls another javascript method, step into. Does it enter that method's definition? | | |<br />| While interrupted in a javascript method, step out. Does execution resume again (or does debugger go back in context)? | | |<br />{background:#009900}. |''. Mixed Qml/JavaScript Debugging |''. Result |''. Annotation |<br />| Breakpoints:<br /># Create a hybrid QML/C++ project (Qt Quick Application). Leave shadow build on.<br /># Select a Qt Version &gt;= 4.8.0.<br /># Check that 'Enable QML debugging' is checked in qmake step on the Build configuration page.<br /># Rebuild.<br /># Make sure &quot;C++&quot; and &quot;QML&amp;quot; Debugging under &quot;Debugger Settings&amp;quot; are enabled in Run Settings.<br /># Place a breakpoint in main.cpp, before QApplication object is constructed.<br /># Place a breakpoint in the onClicked or onTriggered handler in main.qml.<br /># Start debugging the project.<br />Are breakpoints being hit? Do they open the right (non-shadow-build) file? | | |<br />| Breakpoints in bigger project:<br /># Load demos/declarative/minehunt/minehunt.pro from Qt4's, qtquick1/examples/declarative/demos/minehunt/minehunt.pro from Qt5's repository or qtdeclarative/examples/quick/demos/samegame/samegame.pro from Qt5's repository.<br /># Set a breakpoint in Tile.qml (minehunt) respectively GameArea.qml (samegame), onClicked handler of MouseArea. Is it hit? Is the right file opened in the editor? Click continue<br /># While the program is running, use the &quot;Locals and Expressions&amp;quot; view to navigate in the object tree. Are the right files opened in the editor? | | |<br />{background:#009900}. |''. Locals and Expressions |''. Result |''. Annotation |<br />| Preparation:<br /># Start debugging a Quick UI Application.<br /># Activate the &quot;Select&amp;quot; mode with the arrow button in the debugger toolbar.<br /># Make sure the &quot;Locals and Expressions&amp;quot; view is visible.<br /># Click on an item in the running application. | | |<br />| Is selection highlighted in the editor? | | |<br />| Is the selection in the &quot;Locals and Expressions&amp;quot; view updated?<br />Note: In a stack of items, lower-level items can be accessed via double-clicking | | |<br />| Move mouse cursor to another item. Is selection only highlighted in the running application? | | |<br />{background:#009900}. |''. Live Preview |''. Result |''. Annotation |<br />| While being in 'Select' mode (debugger toolbar), click on an item in the running application. Is the right file in the build directory opened, the right line/column selected? | | |<br />{background:#009900}. |''. QML Profiling |''. Result |''. Annotation |<br />| Can you record some profiling data (see below)? | | |<br />| Do all tabs show well-formed data/information for the shown events? | | |<br />| Can you turn on and off the tabs by using the context menu and do all (re-)shown tabs still show well-formed data according to the last profiling? | | |<br />| With and without an already profiled app disable profiling by hitting the record button and start running again. Does the widget 's content still hold the data of the former profiling (or none if there wasn't any)? | | |<br />| Start the application and test the record button. It should show the collected data when disabled, and collect new data on already running application when enabled. | | |<br />| According to the time-line:<br />(Note: The little blue titled subwindows in the timeline are called &quot;tool tip&amp;quot; below, even though they don't behave like normal tooltips.)<br />* Toggle &quot;view event information on mouseover&amp;quot; back and forth. When enabled, does it show up tool tips when hovering over painting, compiling, creating, binding and signal handler markers and do they show well-formed information? When disabled, does it '''not''' show the tooltips?<br />* Does the editor switch to the correct file and line number when clicking on an event (where a location is mentioned)?<br />* Can you drag it in both directions from 0 (zero) to the last event's timestamp?<br />* Can you stretch and squeeze it by using the blue bar beneath the time-line and the zoom-slider and can you seek the blue bar by dragging it or clicking the &quot;thumbnail&amp;quot; of the time-line?<br />* Can you cycle through the events on the time-line by pressing &quot;Jump to previous/next event&amp;quot;?<br />* When selecting time ranges with the &quot;Select range&amp;quot; tool: does the tool tip show the correct time under the cursor? Can you set a mark at a timestamp and can you set a time range and is the displayed time correct? When double clicking on the selected range, does it zoom in to exactly that range? | | |<br />| According to the Callees/Caller/Events tab:<br />* Does the editor switch to the correct file and line number when clicking on an event (Events) or location (Callees/Caller) that is not marked as &quot;&amp;lt;bytecode&amp;amp;gt;&quot;?<br />* Are the relationships between callees and callers correct? (Check at least one, not necessary to be to exhaustive here)<br />* Does column sorting work properly?<br />* Are the events in the root node of each tab the same? (None missing in one of the views?)<br />Note: The &quot;Events&amp;quot; tab intentionally doesn't show anonymous events. | | |<br />{background:#009900}. |''. Debugging/Profiling on Device |''. Result |_. Annotation |<br />| You need 4.8 or newer on device | | |<br />| Try to do both QML and mixed debugging on device | | |<br />| Try to profile an app on the device | | |
{| class="wikitable"
|+Outline (sidebar)
!Test
!Result
!Annotation  
|+
|Navigate to elements / properties by clicking on the item in the outline
|
|
|+
|Change qml in text, check that Outline updates
|automated: tst_qml_outline
|
|+
|Drag&Drop elements around in outline, check that text updates
|
|Has been broken for a while. If it works again, please comment on [https://bugreports.qt.io/browse/QTCREATORBUG-26391 QTCREATORBUG-26391].
|+
|Check/Uncheck 'Show all Bindings' in the Filter, outline should update accordingly
|
|
|}


== Recording Profiling Data ==
{| class="wikitable"
|+Qt Quick Wizards
!Test
!Result
!Annotation
|+
|Create new "Qt Quick Application" through wizard, run application
|automated
|
|-
|Create new "Qt Quick Application (compat)" through wizard, run application
|
|
|+
|Create new "Qt Quick UI Prototype" through wizard, run application
|automated
|
|+
|Generate "Qt Quick 2 Extension Plugin", compile
|automated
|
|}


Create or open a Qt Quick Application '''AND''' a Qml Project ($QTDIR/demos/declarative/minehunt/minehunt.pro and $QTDIR/demos/declarative/samegame/samegame.qmlproject should be adequate). Do the following for each of the projects:<br />* Enable QML debugging on the Projects view (might require rebuilding the app)<br />* Switch to Analyzer view and press the &quot;Start&amp;quot; button at the QML Profiler widget<br />* Generate some events by playing around
{| class="wikitable"
|+JavaScript Debugging
!Test
!Result
!Annotation
|+
|Preparation:
 
#Open samegame.qmlproject from Qt's repository.<br />It's in qtdoc/examples/demos/samegame (https://code.qt.io/cgit/qt/qtdoc.git/)
#Place a breakpoint at the first line of the startNewGame() function (samegame.js) which contains executable code (i.e. not (only) a comment).
#Start debugging app
|
|
|+
|Check that the breakpoint is being hit when clicking on "1 Player", and that the breakpoint loses it's 'hour glass' when hit.
|
|
|+
|Step through startNewGame() function. Check Locals and Expressions update. Also try adding Expression Evaluators, and change content in Locals and Expressions.
|
|
|+
|Add breakpoint while debugging QML. Does the breakpoint interrupt the program?
|
|
|+
|Add breakpoint before starting QML Debugger. Does the breakpoint interrupt the program?
|
|
|+
|While interrupted in a javascript method (with more than one line), step over. Does it go to the next line?
|
|
|+
|While interrupted in a javascript method that calls another javascript method, step into. Does it enter that method's definition?
|
|
|+
|While interrupted in a javascript method, step out. Does execution resume again (or does debugger go back in context)?
|
|
|}
 
{| class="wikitable"
|+Mixed Qml/JavaScript Debugging
!Test
!Result
!Annotation
|+
|Breakpoints:
 
#Create a "Qt Quick Application (compat)" project.
#Make sure in Projects mode that you don't build the project in the source directory.
#Check that "QML debugging and profiling" is enabled in Build Settings.
#Rebuild.
#Make sure "C++" and "QML" Debugging under "Debugger Settings" are enabled in Run Settings.
#Place a breakpoint in main.cpp, before Q(Gui)Application object is constructed.
#Add a signal handler to main.qml, e.g:<pre>onWidthChanged: console.log("Hello World!")</pre>
#Place a breakpoint in this signal handler.
#Start debugging the project.
 
Are breakpoints being hit? Do they open the right file, i.e. the one in the source directory?
|
|
|+
|With the project from the previous test:
 
#Add errors to the qml file.
#Save and close the file.
#Run the project on the desktop.
 
Are the error messages in "Issues" or "Application Output", respectively, clickable when running the app? Do they open the "right", file (in the source directory)?
|
|
|+
|Breakpoints in bigger project:
 
#Load samegame.pro from Qt's repository.<br />It's in qtdoc/examples/demos/samegame
#Set a breakpoint in GameArea.qml, onClicked handler of MouseArea. Is it hit? Is the right file opened in the editor? Click continue.
#While the program is running, use the "Locals and Expressions" view to navigate in the object tree. Are the right files opened in the editor?
|
|
|}
 
{| class="wikitable"
|+QML Profiling
!Test
!Result
!Annotation
|+
|Can you record some profiling data (see below)?
|
|
|+
|Do all tabs show well-formed data/information for the shown events?
|
|
|+
|Can you turn on and off the tabs by using the context menu and do all (re-)shown tabs still show well-formed data according to the last profiling?
|
|
|+
|With and without an already profiled app disable profiling by hitting the record button and start running again. Does the widget 's content still hold the data of the former profiling (or none if there wasn't any)?
|
|
|+
|Start a new analysis and test the record button. It should show the collected data when disabled, and collect new data on already running application when enabled.
|
|
|+
|According to the Timeline tab:
(Note: The little titled subwindows in the timeline are called "tool tip" below, even though they don't behave like normal tooltips.)
 
*Toggle "view event information on mouseover" back and forth. When enabled, does it show up tool tips when hovering over painting, compiling, creating, binding and signal handler markers and do they show well-formed information? When disabled, does it '''not''' show the tooltips?
*Does the editor switch to the correct file and line number when clicking on an event (where a location is mentioned)?
*Can you drag it in both directions from the start of recording to the last event's timestamp?
*Can you stretch and squeeze it by using the overview bar beneath the timeline and the zoom-slider and can you seek the overview bar by dragging it or clicking the "thumbnail" of the timeline?
*Can you cycle through the events on the timeline by pressing "Jump to previous/next event"?
*When selecting time ranges with the "Select range" tool: does the tool tip show the correct time under the cursor? Can you set a mark at a timestamp and can you set a time range and is the displayed time correct? When double clicking on the selected range, does it zoom in to exactly that range?
|
|
|+
|According to the Statistics tab:
 
*Does the editor switch to the correct file and line number when double-clicking on an event (Events) or location (Callees/Caller) that is not marked as "<bytecode>"?
*Does the percentage shown in the line annotation match the percentage shown in the statistics?
*Are the relationships between callees and callers correct? (Check at least one, not necessary to be to exhaustive here)
*Does column sorting work properly?
|
|
|+
|On the Flame Graph tab:
 
*Does the editor switch to the correct file and line number when clicking on an item?
*Double-click an item. Is it being zoomed in and are items above it resized accordingly? Can you zoom back to the full display?
*Show the different views using the combo box (Total Time, Memory, Allocations). Do they all show something that looks sane?
|
|
|}
 
==Recording Profiling Data==
 
Create or open a project. To record data:
 
*Enable QML debugging in the Projects mode (might require rebuilding the app)
*Switch to Debug mode, QML Profiler view and press the "Start" button at the QML Profiler view
*Generate some events by playing around in the running application
*Press "Stop" at the QML Profiler view
 
Try if this works with a Qt Quick Application as well as with a Qml Project. samegame.pro and samegame.qmlproject should be adequate. They are in qtdoc/examples/demos/samegame

Latest revision as of 11:47, 12 March 2024


QML Editor
Test Result Annotation
Open Qml files, make them invalid & again valid, check that errors are underlined
Indent a big Qml file via "Ctrl-I" automated
Hover over elements, properties, expressions automated
Rename an ID via context menu automated
Trigger Find Usages on an id and property automated
Outline (sidebar)
Test Result Annotation
Navigate to elements / properties by clicking on the item in the outline
Change qml in text, check that Outline updates automated: tst_qml_outline
Drag&Drop elements around in outline, check that text updates Has been broken for a while. If it works again, please comment on QTCREATORBUG-26391.
Check/Uncheck 'Show all Bindings' in the Filter, outline should update accordingly
Qt Quick Wizards
Test Result Annotation
Create new "Qt Quick Application" through wizard, run application automated
Create new "Qt Quick Application (compat)" through wizard, run application
Create new "Qt Quick UI Prototype" through wizard, run application automated
Generate "Qt Quick 2 Extension Plugin", compile automated
JavaScript Debugging
Test Result Annotation
Preparation:
  1. Open samegame.qmlproject from Qt's repository.
    It's in qtdoc/examples/demos/samegame (https://code.qt.io/cgit/qt/qtdoc.git/)
  2. Place a breakpoint at the first line of the startNewGame() function (samegame.js) which contains executable code (i.e. not (only) a comment).
  3. Start debugging app
Check that the breakpoint is being hit when clicking on "1 Player", and that the breakpoint loses it's 'hour glass' when hit.
Step through startNewGame() function. Check Locals and Expressions update. Also try adding Expression Evaluators, and change content in Locals and Expressions.
Add breakpoint while debugging QML. Does the breakpoint interrupt the program?
Add breakpoint before starting QML Debugger. Does the breakpoint interrupt the program?
While interrupted in a javascript method (with more than one line), step over. Does it go to the next line?
While interrupted in a javascript method that calls another javascript method, step into. Does it enter that method's definition?
While interrupted in a javascript method, step out. Does execution resume again (or does debugger go back in context)?
Mixed Qml/JavaScript Debugging
Test Result Annotation
Breakpoints:
  1. Create a "Qt Quick Application (compat)" project.
  2. Make sure in Projects mode that you don't build the project in the source directory.
  3. Check that "QML debugging and profiling" is enabled in Build Settings.
  4. Rebuild.
  5. Make sure "C++" and "QML" Debugging under "Debugger Settings" are enabled in Run Settings.
  6. Place a breakpoint in main.cpp, before Q(Gui)Application object is constructed.
  7. Add a signal handler to main.qml, e.g:
    onWidthChanged: console.log("Hello World!")
  8. Place a breakpoint in this signal handler.
  9. Start debugging the project.

Are breakpoints being hit? Do they open the right file, i.e. the one in the source directory?

With the project from the previous test:
  1. Add errors to the qml file.
  2. Save and close the file.
  3. Run the project on the desktop.

Are the error messages in "Issues" or "Application Output", respectively, clickable when running the app? Do they open the "right", file (in the source directory)?

Breakpoints in bigger project:
  1. Load samegame.pro from Qt's repository.
    It's in qtdoc/examples/demos/samegame
  2. Set a breakpoint in GameArea.qml, onClicked handler of MouseArea. Is it hit? Is the right file opened in the editor? Click continue.
  3. While the program is running, use the "Locals and Expressions" view to navigate in the object tree. Are the right files opened in the editor?
QML Profiling
Test Result Annotation
Can you record some profiling data (see below)?
Do all tabs show well-formed data/information for the shown events?
Can you turn on and off the tabs by using the context menu and do all (re-)shown tabs still show well-formed data according to the last profiling?
With and without an already profiled app disable profiling by hitting the record button and start running again. Does the widget 's content still hold the data of the former profiling (or none if there wasn't any)?
Start a new analysis and test the record button. It should show the collected data when disabled, and collect new data on already running application when enabled.
According to the Timeline tab:

(Note: The little titled subwindows in the timeline are called "tool tip" below, even though they don't behave like normal tooltips.)

  • Toggle "view event information on mouseover" back and forth. When enabled, does it show up tool tips when hovering over painting, compiling, creating, binding and signal handler markers and do they show well-formed information? When disabled, does it not show the tooltips?
  • Does the editor switch to the correct file and line number when clicking on an event (where a location is mentioned)?
  • Can you drag it in both directions from the start of recording to the last event's timestamp?
  • Can you stretch and squeeze it by using the overview bar beneath the timeline and the zoom-slider and can you seek the overview bar by dragging it or clicking the "thumbnail" of the timeline?
  • Can you cycle through the events on the timeline by pressing "Jump to previous/next event"?
  • When selecting time ranges with the "Select range" tool: does the tool tip show the correct time under the cursor? Can you set a mark at a timestamp and can you set a time range and is the displayed time correct? When double clicking on the selected range, does it zoom in to exactly that range?
According to the Statistics tab:
  • Does the editor switch to the correct file and line number when double-clicking on an event (Events) or location (Callees/Caller) that is not marked as "<bytecode>"?
  • Does the percentage shown in the line annotation match the percentage shown in the statistics?
  • Are the relationships between callees and callers correct? (Check at least one, not necessary to be to exhaustive here)
  • Does column sorting work properly?
On the Flame Graph tab:
  • Does the editor switch to the correct file and line number when clicking on an item?
  • Double-click an item. Is it being zoomed in and are items above it resized accordingly? Can you zoom back to the full display?
  • Show the different views using the combo box (Total Time, Memory, Allocations). Do they all show something that looks sane?

Recording Profiling Data

Create or open a project. To record data:

  • Enable QML debugging in the Projects mode (might require rebuilding the app)
  • Switch to Debug mode, QML Profiler view and press the "Start" button at the QML Profiler view
  • Generate some events by playing around in the running application
  • Press "Stop" at the QML Profiler view

Try if this works with a Qt Quick Application as well as with a Qml Project. samegame.pro and samegame.qmlproject should be adequate. They are in qtdoc/examples/demos/samegame