Skip to main content

Testing your application

2 Aufgaben

40 Min.

Sichtbar für: All users Applies to: Pega Platform '24.2
Anfänger
DevOps
Englisch
Prüfen Sie die Version, um sicherzustellen, dass Sie mit dem richtigen Inhalt arbeiten, oder schließen Sie die neueste Version ab.

Szenario

The Senior System Architect configured the vehicle information list to fetch car models from an external source. During the testing phase, one of the engineers reported that, intermittently, some car makes do not have associated model names. Additionally, stakeholders are concerned about application performance and require that the vehicle information list is generated within 200 milliseconds.

To meet these requirements, the Deployment Manager has asked you to:

  • Create unit tests to test the vehicle information list and confirm the model list generates in the time threshold.
  • Run a Test Coverage session using the unit tests and report the results. 

The following table provides the credentials you need to complete the challenge.

Role User name Password
Application Developer tester@gogoroad pega123!

 

Hinweis:  Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

Sie müssen zum Abschließen dieser Challenge Ihre eigene Pega-Instanz starten.

Die Initialisierung kann bis zu 5 Minuten dauern, bitte haben Sie Geduld.

Challenge-Schritte

Genaue Übungsschritte

1 Run the List Vehicle information Data Page and create a unit test

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter tester@gogoroad.
    2. In the Password field, enter pega123!.
  2. In the navigation pane of Dev Studio, click Data types to open the Data Explorer.
  3. Expand Vehicle information, and then click List Vehicle information to edit the D_VehicleinformationList Data Page.
    Vehicle information list data page
  4. In the upper right, click Actions > Run. The Run Data Page window is displayed.
  5. For the make parameter, in the Value field, enter Tesla as the test value.
  6. For the modelyear parameter, in the Value field, enter 2017 as the test value.
  7. In the upper right, click Run to test the Data Page.
  8. Expand the pxResults property and confirm that the property includes three results pages.
    The vehicleinformationlist data page run screen with Tesla and 2017 as parameters.
  9. In the upper right, click Convert to test to close the Run Data Page window and create a test case record for the Data Page that uses your test results.
    Convert to test
    Hinweis: The parameter values entered in the Run Data Page window are automatically populated in the Edit Test Case window.
    Unit Test Case Parameters
  10. In the Edit Test Case window, in the Expected results section, verify that the Assertion type list value is Expected run time.
  11. In the Value field, enter 0.2 to set the passing threshold for the unit test to 0.2 seconds.
    Unit test expected run time 0.2 seconds
  12. In the second Assertion type list, select Result count
  13. In the of object field, enter or select .pxResults.
  14. In the Comparator list, select is greater than.
  15. In the Value field, enter 0. The unit test validates that at least 1 record is returned from the Data Page when the make parameter value is Tesla.
    Assertion type
  16. Click Save.
  17. In the Label field, enter VehicleInformationList_Tesla to name the test case record.
  18. In the Add to Ruleset and version lists, verify that the highest Ruleset version is selected.
    TC_VehicleInformationList_Tesla save configuration
  19. Click Submit to create the unit test.

2 Create unit tests for different vehicle makes

  1. In the VehicleInformationList_Tesla test case, to the right of Save, click the down arrow.
    Saveas button on the unit test case
  2. Click Save as.
  3. In the Label field, enter VehicleInformationList_Ford.
  4. Click Create and open to save a copy of the test case.
  5. To the right of Class, click the Gear icon to open the Edit details window and update the rule parameters.
    Unit test case edit parameters gear icon
  6. In the Parameter(s) sent section, in the make field, enter Ford.
    Unit test case edit details
  7. Click Submit to close the Edit details window.
  8. In the Description section, click the Edit icon to edit the vehicle make.
  9. In the parameters area, enter Ford to replace the Tesla value for <make: Tesla>.
    VehicleInformationList unit testcase
     
  10. Click Save to complete the configuration of the unit test. 
  11. Repeat steps 1-10 to use VehicleInformationList_Saturn as the test case label and Saturn as the make parameter.
    Vehicle Information Saturn Pega unit test case

In dieser Challenge üben Sie, was Sie im folgenden Modul gelernt haben:


In der folgenden Mission verfügbar:

Wenn Probleme mit den Lerninhalten auftreten, lesen Sie bitte die Pega Academy Support FAQs.

Fanden Sie diesen Inhalt hilfreich?

Möchten Sie uns dabei helfen, diesen Inhalt zu verbessern?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice