PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This page concerns the 270056D version of WINDEV 27. Update your version.
  • In this lesson you will learn the following concepts
  • Overview
  • Dashboard
  • Automated tests
Lesson 4.12. Monitor changes in your applications
In this lesson you will learn the following concepts
  • What is the dashboard?
  • Automated tests.
Lesson duration

Estimated time: 20 mn
Previous LessonTable of contentsNext Lesson
Overview
The project dashboard is an essential element for managing 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 automated tests and the optimization of queries.

  • Open the project you worked on in the previous lesson.
    1. Go to the WINDEV home page (Ctrl + <).
    2. On the home page, click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Exercise)".
    3. A dialogue box prompts you to open the project you worked on in the previous lesson. You can open the local copy or the original project. Select "Open the local copy".

Answers

A corrected project is available. This project contains the elements created in this lesson. To open the corrected project, go to the home page and click "Tutorial", then in "Part 4 - Full application with data", double-click "Full application (Answers)".
  • To view the project dashboard (if necessary), go to the "Project" tab, "Project" group and click Display project dashboard.
Dashboard
Project dashboard
The project dashboard includes several widgets. Each widget displays different information about the project.
For example, the "Performance" 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 can enable, disable, add or delete a widget at any time.
Automated tests
One of the most interesting features of the dashboard is to give information about the tests that have been run on the application.
We have tested multiple features while developing our application.
The automated tests are a category of specific tests. The automated tests are used to automatically perform some operations on your windows. These tests are recorded as WLanguage scenarios and can be easily modified in the code editor. Once recorded, automated tests can be re-run as many times as necessary, to test, for example, the impact of a change made to a window, procedure, etc.
Let's give it a try! We are going to create an automated test on the edit window that was created at the beginning of this lesson.

Note

Automated tests can be run on windows, procedures and classes.
  • To create an automated 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 "Automated tests" tab, in the "Tests" group, expand "New" and select "Record a new scenario".
    3. In the window that appears, click "Start recording".
    4. The test of the window is run.
    5. Click the "Find orders" tab pane.
    6. Choose the "Credit card" payment mode.
    7. Click "Find".
    8. Close the window via "Menu .. Exit" and exit the application.
    9. The recording of the automated test has ended.
    10. The test editor proposes to save a description for the automated test we just created. Enter the name of the automated test: "Test for finding orders". Validate.
    11. The test editor displays the WLanguage code of the test that has just been recorded:
      WLanguage code of an automated test
      The test is currently available and has not been run ( Available test next to the name of the test in the editor).
    12. The test can be run at any time:
      • Select the test name in the test editor.
      • Right-click and select "Run" in the context menu.
    13. The test is automatically run and the test editor displays the result in the "Test results" pane (the test was successfully run in our case).
    14. Save the test if necessary ( Save or Ctrl + S)

      Note

      The WLanguage functions used to run automated tests are the EmulateXXX functions.
  • We will make some changes to the window and run the test again. The modification affects the "Find" Button control. It will be grayed out.
    1. Open the "WIN_Menu" window if necessary.
    2. In the editor, click the "Find orders" tab pane and select the "Find" Button control.
    3. Open the control description (select "Description" in the context menu).
    4. In the "UI" tab, select "Grayed".
    5. Validate the control description window.
    6. Save the window.
    7. Go back to the test editor (click the corresponding tab in the open document tabs).
    8. Run the test again.
    9. The test appears again in the test editor. The "Compilation errors" tab pane reports several test errors.
    10. Open again the "WIN_Menu" window in the editor.
    11. Open the description of the "Find" Button control (select "Description" in the context menu).
    12. In the "UI" tab, select "Enabled".
    13. Validate the control description window.
    14. Go back to the test editor (click the corresponding tab in the open document tabs).
    15. Run the test again. The test is now completed successfully.
  • The test editor also allows you to change or add WLanguage code in the test scenarios. We will add some lines of code to check if the Table control contains at least one record.
    1. Open the test editor if necessary (for example, double-click "TEST_Menu" in the "Tests" folder of the "Project explorer" pane).
    2. Add the following code before the "EmulateMenu("_Menu","OPT_Exit")" line:
      // 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 the search")
      END
      Modifying the WLanguage code of an automated test
    3. Save the test ( Save or Ctrl + S)
    4. Click Test an element. The test is completed successfully. The Table control contains at least one record.
The test editor offers several features that will not be presented in this tutorial:
  • the use of a set of test values.
  • the input and output parameters of the test.
  • the possibility to create a test library to test an executable on a computer other than the development computer for example.
For more details on automated tests, see Overview of automated tests.
  • Close the automated test editor.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 27
Comments
Click [Add] to post a comment