Qt Creator ManualTests QtQuick: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add link to qtdoc repo)
(Updated Qt Quick Wizards)
Line 2: Line 2:


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


{| class="wikitable"
{| class="wikitable"
|+ Outline (sidebar)
|+Outline (sidebar)
! Test  
!Test
! Result  
!Result
! Annotation  
!Annotation  
|+
|+
| Navigate to elements / properties by clicking on the item in the outline
|Navigate to elements / properties by clicking on the item in the outline
|
|
|
|
|+
|+
| Change qml in text, check that Outline updates
|Change qml in text, check that Outline updates
| automated: tst_qml_outline
|automated: tst_qml_outline
|
|
|+
|+
| Drag&Drop elements around in outline, check that text updates
|Drag&Drop elements around in outline, check that text updates
|
|
|
|
|+
|+
| Check/Uncheck 'Show all Bindings' in the Filter, outline should update accordingly
|Check/Uncheck 'Show all Bindings' in the Filter, outline should update accordingly
|
|
|
|
Line 52: Line 52:


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


{| class="wikitable"
{| class="wikitable"
|+ JavaScript Debugging
|+JavaScript Debugging
! Test  
!Test
! Result  
!Result
! Annotation  
!Annotation  
|+
|+
| Preparation:
|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).
#Open samegame.qmlproject from Qt's repository.<br />It's in qtdoc/examples/demos/samegame (https://code.qt.io/cgit/qt/qtdoc.git/)
# Start debugging app
#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.
|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.
|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 while debugging QML. Does the breakpoint interrupt the program?
|
|
|
|
|+
|+
| Add breakpoint before starting QML Debugger. 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 (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 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)?
|While interrupted in a javascript method, step out. Does execution resume again (or does debugger go back in context)?
|
|
|
|
Line 113: Line 118:


{| class="wikitable"
{| class="wikitable"
|+ Mixed Qml/JavaScript Debugging
|+Mixed Qml/JavaScript Debugging
! Test  
!Test
! Result  
!Result
! Annotation  
!Annotation  
|+
|+
| Breakpoints:
|Breakpoints:
# Create a "Qt Quick Application" project.
 
# Make sure in Projects mode that you don't build the project in the source directory.
#Create a "Qt Quick Application" project.
# Check that "QML debugging and profiling" is enabled in Build Settings.
#Make sure in Projects mode that you don't build the project in the source directory.
# Rebuild.
#Check that "QML debugging and profiling" is enabled in Build Settings.
# Make sure "C++" and "QML" Debugging under "Debugger Settings" are enabled in Run Settings.
#Rebuild.
# Place a breakpoint in main.cpp, before Q(Gui)Application object is constructed.
#Make sure "C++" and "QML" Debugging under "Debugger Settings" are enabled in Run Settings.
# Add a signal handler to main.qml, e.g:<pre>onWidthChanged: console.log("Hello World!")</pre>
#Place a breakpoint in main.cpp, before Q(Gui)Application object is constructed.
# Place a breakpoint in this signal handler.
#Add a signal handler to main.qml, e.g:<pre>onWidthChanged: console.log("Hello World!")</pre>
# Start debugging the project.
#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?
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:
|With the project from the previous test:
# Add errors to the qml file.
 
# Save and close the file.
#Add errors to the qml file.
# Run the project on the desktop.
#Save and close the file.
#Run the project on the desktop.
 
Are the error messages in Application Output clickable when running the app? Do they open the "right", file (in the source directory)?  
Are the error messages in Application Output clickable when running the app? Do they open the "right", file (in the source directory)?  
|
|
|
|
|+
|+
| Breakpoints in bigger project:
|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.
#Load samegame.pro from Qt's repository.<br />It's in qtdoc/examples/demos/samegame
# 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?
#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?
|
|
|
|
Line 149: Line 159:


{| class="wikitable"
{| class="wikitable"
|+ QML Profiling
|+QML Profiling
! Test  
!Test
! Result  
!Result
! Annotation  
!Annotation  
|+
|+
| Can you record some profiling data (see below)?
|Can you record some profiling data (see below)?
|
|
|
|
|+
|+
| Do all tabs show well-formed data/information for the shown events?
|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?
|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)?
|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 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.
|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.
|
|
|
|
|+
|+
| According to the Timeline tab:
|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.)
(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)?
*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?
* Can you drag it in both directions from the start of recording to the last event's timestamp?
*Does the editor switch to the correct file and line number when clicking on an event (where a location is mentioned)?
* 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 drag it in both directions from the start of recording to the last event's timestamp?
* Can you cycle through the events on the timeline by pressing "Jump to previous/next event"?
*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?
* 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?
*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:
|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 right of the line match the percentage shown in the statistics?
*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>"?
* Are the relationships between callees and callers correct? (Check at least one, not necessary to be to exhaustive here)
*Does the percentage shown right of the line match the percentage shown in the statistics?
* Does column sorting work properly?
*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:
|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?
*Does the editor switch to the correct file and line number when clicking on an item?
* Show the different views using the combo box (Total Time, Memory, Allocations). Do they all show something that looks sane?
*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 ==
==Recording Profiling Data==


Create or open a project. To record 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
*Enable QML debugging in the Projects mode (might require rebuilding the app)
* Generate some events by playing around in the running application
*Switch to Debug mode, QML Profiler view and press the "Start" button at the QML Profiler view
* Press "Stop" 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
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

Revision as of 05:57, 1 June 2023


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
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" 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 Application Output 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 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.
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 right of the line 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