Skip to main content
Version: 9.0.0

Pega-Model

Overviewโ€‹

The Pega-Model library is a culmination of our extensive experience in testing Pega applications. Our aim is to simplify automated testing, making it stable, fast, reliable, and easy to implement and maintain. The genesis of this library lies in the concept of reusable components, addressing the challenges posed by automating Pega testing, such as repeatable elements, sections, iframes with generic selectors, and a complex DOM structure.

The Pega-Model library adeptly handles these intricate scenarios, empowering even citizen developers to effortlessly implement straightforward test cases for Pega applications. No longer do you need to build each control from the ground up; instead, you can leverage existing controls. We've curated a wealth of control methods (e.g., for text input fields, dropdowns, autocomplete, radio buttons, multiselection fields, and other out-of-the-box Pega controls) and widgets (e.g., login, logoff, create case, menu, left panel, iframe, action button, etc.).

Continual enhancements ensure the reliability and maintainability of this library. A smart operator manager facilitates seamless parallel test execution, while a state-tracker contributes to test stability, eliminating the need for countless implicit waits. With Pega-Model, your tests become flexible, easy to construct, adjust, and reuse.

Follow these steps to get up to speed up ๐Ÿ‘‡๐Ÿผโ€‹

  1. Install the Pega-model library (you must have Test Maker installed too).

  2. Give some meaningful data-test-id to Pega controls and UI elements used in the application (it is recommended, but it's not a must. It is possible to implements tests with any type of selectors: id, xpath, texts, etc.).

  3. Implement the test cases in the Data-Driven style by applying Page Objects.

  4. Use an Operator Manager to create the user pool to avoid conflicts in Pega, and to be able to run the test cases in parallel.

  5. Enable an Is App Busy Evaluator.

  6. Run easy to maintain, reliable test cases in different environments using 'extra' configuration settings.

Controls and widgetsโ€‹

The main widgets and controls available in Pega-model are:

Controls:

  • any picker
  • autoัompletion field
  • button
  • custom control (element)
  • checkbox
  • date picker
  • date range
  • dropdown
  • image
  • label
  • logo
  • multiselect
  • radiobutton
  • readonly text input
  • rich text editor
  • table
  • text area
  • text input

Widgets:

  • actions button
  • alerts
  • assignment title
  • case
  • caseworker menu
  • frame
  • left panel menu
  • login form
  • menu
  • right panel menu
  • status

Talking about controls, don't forget there are different ways of selecting an identifier (a selector) for the element you want to interact with. The most common approach in Pega application is to give some meaningful and readable data-test-ids (at least automatically generated). Apart from that, you can also use ids, and other attributes, for some elements it's also possible to pass xpath or css (not for all of them though). Don't hesitate to add a container option also if needed (if the element is not unique, this approach might help. First of all, you need to find a "container" selector: section, or some UI part that contains only one element with the given selector and specify this container selector as a second parameter of the method. In this case, Pega-model is looking for the element only inside the container and skips other elements with the same selector).

All the methods below are looking for the same element and performing the same action:

await pega.textInput('TestTextInput').shouldBeVisible();

await pega.textInputByDataTestId('TestTextInput').shouldBeVisible();

await pega.textInputByXPath
('//input[@data-test-id="TestTextInput"]').shouldBeVisible();

await pega.textInputByCss('input[data-test-id="TestTextInput"]').shouldBeVisible();

await pega.textInputBy('data-test-id', 'TestTextInput').shouldBeVisible();

await pega.textInputByLabel('Test Text input').shouldBeVisible();

await pega.textInputByXPath
(`//input`, `//*[@node_name="TestScreen"]`).shouldBeVisible(); //xpath + container

In Pega-model it is also possible to set custom timeouts, intervals, retries (in the same way it is done in Test Maker):

await pega.elementByXpath(`//input[@id="New Element"]`, `//*[@node_element="Test Section"]`)
.shouldNotHaveTextByIndex("Expected Text", 1, {timeout: 10000, interval: 500, retries: 20});

If it is not specified in the method, the default one is used (from the current project configuration files or default Test Maker values).

important

If you are using a PEGA Model Library, it doesn't mean you are limited to this library only. You can combine it with Test Maker functionality, perform required actions in any other third-party applications and go back to Pega. There are no limits for these actions.