Descriptions and Metadata

Page Object Description

To help a test writer understand when and how to use a page object, add a description at the root level. It's an optional field that can have a simplified string format, or an object format for longer descriptions.

Here's an example of a simplified string description property:

{
    "description": "Selector: lightning-accordion. Represents the lightning-accordion Lightning web component. Access a list of all accordion sections or select a section by its title."
}

Tip: It's a good idea to reference the page object root selector for easier search.

Here's a code snippet of a generated page object, which includes the description in its JavaDoc or JSDoc:

/**
 * Selector: lightning-accordion. Represents the lightning-accordion Lightning web component.
 * Access a list of all accordion sections or select a section by its title.
 *
 * @author UTAM
 * @version 2022-02-26 19:40:45
 */

If the description is long or if the developer also wants to point to the author of the page object, the description can be an object:

{
    "description": {
        "text": ["very", "long", "text"],
        "author": "my scrum team",
        "deprecated": "since Summer '22 release, use MyOtherComponent"
    }
}

Here's a code snippet of a generated page object, which includes the description in its JavaDoc or JSDoc:

/**
 * very
 * long
 * text
 *
 * @author my scrum team
 * @version 2022-02-26 19:40:45
 * @deprecated since Summer'22 release, use MyOtherComponent
 */

Page Object Metadata

To help organizations with a large number of page objects track miscellaneous information for each page object, you can add a metadata object property. This property is optional and its contents are entirely ignored by the compiler; however, if you define this property in a page object, the value must be a JSON object. Use the property to track whatever information is useful to you.

This example uses the metadata property to track the status and teamOwner for a page object.

{
    "metadata": {
        "status": "In Development",
        "teamOwner": "Test Automation Team"
    }
}