PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV 24 feature!
  • This lesson will teach you the following concepts
  • Overview
  • The dashboard
  • Automatic tests
Lesson 4.13. Monitor the evolution of your applications
This lesson will teach you the following concepts
  • What is the dashboard?
  • Automatic tests.

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
Overview
The project dashboard is an essential element for managing the WINDEV projects. The project dashboard gives an overall view of the progress of a project.
The dashboard includes several elements (widgets) that give an overall view of the project status.
In this section, we will present the operations that can be performed on the dashboard elements as well as the management of automatic tests and the optimization of queries.

Answer

If you did not create the windows in the previous lessons, you can follow this lesson by opening a corrected project: in the WINDEV home page (Ctrl + <), click "Tutorial" and select "Full application (With windows)".
A full corrected application project is also available: in the WINDEV home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)"
  • To display the project dashboard (if not already done), on the "Project" pane, in the "Project" group, click .
The dashboard
The project dashboard includes several Widgets. Each Widget displays various information about the project.
For example, the "Performances" Widget is used to start the performance profiler or to open the last performance report.
The "Static audit and Compilation" Widget is used to quickly see whether the project contains compilation errors. You have the ability to enable (or not) a Widget, to add one or to delete one at any time.
Automatic tests
One of the most interesting features of the dashboard is to give information about the tests that have been run on the application.
Several tests have already been run while developing our application.
The automatic tests are a category of specific tests. The automatic tests are used to automatically perform some operations on your windows. These tests are recorded as WLanguage scenarios and they can be easily modified in the code editor. Once recorded, the automatic test can be re-run as many times as necessary, to test for example the impact of a modification made to a window, a procedure, ...
Let's give it a try! We are going to create an automatic test on the edit window that was created at the beginning of this lesson.

Note

The automatic tests can be run on the windows, procedures, classes.
  • To create an automatic test on a window, all you have to do is run the test of the window:
    1. Open the "WIN_Menu" window in the editor.
    2. On the "Automatic tests" pane, in the "Tests" group, expand "New" and select "Record a new scenario".
    3. In the window that is displayed, click "Start recording".
    4. The test of the window is run.
    5. Click the "Finding orders" tab.
    6. Choose the "Credit card" payment mode.
    7. Click the "Find" button.
    8. Close the window via "Menu .. Exit" and confirm the end of application.

      Note

      This option may not be available if you did not follow the entire tutorial. In this case, click the "x" to close the window.
    9. The recording of the automatic test has ended.
    10. The test editor proposes to save a description for the automatic test we just created. Enter the name of the automatic test: "Test for finding orders". Validate.
    11. The test editor displays the WLanguage code of the test that was just saved:
      The test is available and it is not passed ( icon in front of the test name in the editor).
    12. The test can be run at any time:
      • Select the test name in the test editor.
      • In the popup menu (right mouse click), select "Run".
    13. The test is automatically run and the test editor displays the result in the "Test result" pane (the test was successfully run in our case).
    14. Save the test if necessary.

      Note

      The WLanguage functions used to run automatic tests are the EmulateXXX functions.
  • We are now going to perform a modification in our window and to run the test again. The modification affects the "Find" button. We are going to gray it.
    1. Display the "WIN_Menu" window if necessary.
    2. In the editor, click the "Finding orders" tab and select the "Find" button.
    3. Display the description of "Find" button ("Description" from the popup menu).
    4. In the "GUI" tab, select "Grayed".
    5. Validate the description window of control.
    6. Save the window.
    7. Go back to the test editor (click the corresponding button in the bar of opened elements).
    8. Run the test again.
    9. The test appears again in the test editor. The "Compilation errors" pane signals several test errors.
    10. Redisplay the "WIN_Menu" window in the editor.
    11. Display the description of "Find" button ("Description" from the popup menu).
    12. In the "GUI" tab, select "Enabled".
    13. Validate the description window of control.
    14. Go back to the test editor (click the corresponding button in the bar of opened elements).
    15. Run the test again. The test is now successfully run.
  • Another feature of the test editor is the ability to modify or add WLanguage code in the test scenarios. We are going to add code lines to check whether the Table control contains at least one record.
    1. Display the test editor if necessary (e.g. double-click "TEST_Menu" in the "Tests" folder of the project explorer).
    2. Add the following code before the line "EmulateMenu("_Menu","OPT_Exit")":
      // If the Table control contains no record
      IF WIN_Menu.TABLE_QRY_FindOrders..Count = 0 THEN
      // An error must be signaled
      TestWriteResult(twrError, ...
       "The Table control is empty after search")
      END
    3. Save the test.
    4. Click the icon. The test is successfully run. Indeed, our Table control contains at least one record.
The test editor proposes several features that will not be presented in this tutorial:
  • the ability to use a set of test values.
  • the definition of input and output parameters for the test.
  • the ability to create a test library to run the test of an executable on a computer other than the development computer for example.
See Overview of automatic tests for more details about the automatic tests.
  • Close the editor of automatic tests.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment