Radiobuttons
With Radiobutton control, you can refer to a single radiobutton or radiobutton group.
Possible options to select a radiobutton or radiobutton group:
Name | Parameter(s) | Type | Description |
---|---|---|---|
radioButton | dataTestId | string | Searches for a radiobutton by value of a Pega data-test-id attribute, same as radioButtonByDataTestId or radioButtonGroupByDataTestId |
container? | string | ||
radioButtonByDataTestId | dataTestId | string | Searches for a radiobutton by value of a Pega data-test-id attribute, same as radioButton or radioButtonGroupByDataTestId |
container? | string | ||
radioButtonGroupByDataTestId | dataTestId | string | Searches for a radiobutton group by value of a Pega data-test-id attribute, same as radioButton or radioButtonByDataTestId |
container? | string | ||
radioButtonByPartialId | id | string | Searches for a radiobutton by partial value* of an id attribute (same as radioButtonGroupByPartialId ) |
container? | string | ||
radioButtonGroupByPartialId | id | string | Searches for a radiobutton group by partial value* of an id attribute (same as radioButtonByPartialId ) |
container? | string | ||
radioButtonByAriaLabel | areaLabel | string | Searches for a radiobutton by value of an aria-label attribute** |
container? | string | ||
radioButtonGroupByAriaLabel | areaLabel | string | Searches for a radiobutton group by value of an aria-label attribute** |
container? | string | ||
radiobuttonByCss | css | string | Searches for a radiobutton by a custom scc selector |
radiobuttonByXPath | xpath | string | Searches for a radiobutton by a custom xpath selector |
container? | string |
*Partial id and **Aria-Label
Using checkbox methods, we are interacting with one specific element, while radiobutton always involves GROUP og elements. That's why the value is a mandatory parameter for each radiobutton method. Radiobuttons can be found in DOM by aria-label attribute, data-test-id or by partial id (the structure of the radiobuttons ids in Pega is always the same: a common part of the id + the value., e.g. in the example below it`s 'eccdbbaeMale' and 'eccdbbaeFemale'. We need a COMMON part of the id - 'eccdbbae'). Aria-label allows to find a radiobutton group easily and usually is equal to radiobutton group label. Check the example below:
<div data-template="" data-test-id="Gender" role="radiogroup" aria-label="Gender" radvalue="" data-ctl="RadioGroup" class="radioTable"><div>
<span class="col-3">
<input id="eccdbbaeMale" type="radio" name="$PpyWorkPage$pGender" aria-describedby="$PpyWorkPage$pGenderError" value="Male" class="Radio rb_ " style="vertical-align:middle;" aria-invalid="false">
<label title="" for="eccdbbaeMale" class="rb_ rb_standard radioLabel">Male</label>
</span>
<span class="col-3">
<input id="eccdbbaeFemale" type="radio" name="$PpyWorkPage$pGender" aria-describedby="$PpyWorkPage$pGenderError" value="Female" class="Radio rb_ " style="vertical-align:middle;" aria-invalid="false">
<label title="" for="eccdbbaeFemale" class="rb_ rb_standard radioLabel">Female</label>
</span>
</div></div>
As a result, possible options are:
await pega.radioButtonGroupByAriaLabel('Gender').shouldNotBeChecked('Male');
await pega.radioButtonByPartialId('eccdbbae').shouldBeVisible('Female');
await pega.radioButtonByPartialId('eccdbbae').click('Male');
Main action functions
For radiobuttons, main actions work slightly different depending on selection type. Elements selected by partial id are based on the inner text; radiobuttons selected by data-test-id or aria-label are based on value attribute.
Name | Parameter(s) | Type | Selection type | Description |
---|---|---|---|---|
click | value | string | by partial id | Selects a radiobutton element by inner text (same as select ) |
options? | { index?: number, timeout?: number, retries?: number, interval?: number } | |||
click | value | string | by aria-label or data-test-id | Selects a radiobutton by value of the value attribute (same as select ) |
options? | { index?: number, timeout?: number, retries?: number, interval?: number } | |||
select | value | string | by partial id | Selects a radiobutton element by inner text (same as click ) |
options? | { index?: number, timeout?: number, retries?: number, interval?: number } | |||
select | value | string | by aria-label or data-test-id | Selects a radiobutton element by value of the value attribute (same as click ) |
options? | { index?: number, timeout?: number, retries?: number, interval?: number } |
Assertions
Specific assertions
Name | Parameter(s) | Type | Description |
---|---|---|---|
shouldBeChecked | value | string | Verifies if the checkbox element has a checked attribute |
options? | { index?: number, timeout?: number, retries?: number, interval?: number, soft?: boolean } | ||
shouldBeUnChecked | value | string | Verifies if the checkbox element does not have a checked attribute |
options? | { index?: number, timeout?: number, retries?: number, interval?: number, soft?: boolean } |
Common assertions
Name | Parameter(s) | Type | Description |
---|---|---|---|
shouldBeVisible | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists and is visible |
shouldExist | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists |
shouldNotBeVisible | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element exists but is not visible |
shouldNotExist | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element does not exist |
shouldBeEnabled | options? | { index?: number, timeout?: number, assertionTimeout?: number, interval?: number, retries?: number, soft?: boolean } | Checks if the element doesn't have a disabled attribute |
Wait for
functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitUntilVisibility | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to be visible |
waitUntilInvisibility | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to be invisible |
waitUntilElementExists | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element to exist |
waitUntilElementNotExist | options? | { timeout?: number, interval?: number, retries?: number } | Waits for the element not to exist |
Actionability check
ActionabilityCheckTypes == attached
| stable
| visible
| enabled
| editable
Name | Parameter(s) | Type | Description |
---|---|---|---|
waitForSelectActionabilityCheck | check types | [] | Waits for the element to pass all the selected actionability check types |
isFilterByVisibility | boolean (true by default) |
e.g.
await pega.radiobutton('24972094628502592').waitForSelectActionabilityCheck(['attached', 'visible', 'stable']);
IsVisible and IsExists functions
Name | Parameter(s) | Type | Description |
---|---|---|---|
isVisible | options? | { timeout?: number, interval?: number, retries?: number } | Returns true if the element exists and is visible |
isExists | options? | { timeout?: number, interval?: number, retries?: number } |