* Return the checked status of given element. * * @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator. * @param {object} [options] See https://playwright.dev/docs/api/class-locator#locator-is-checked * @return {Promise } *
(locator, options = {})
| 1556 | */ |
| 1557 | |
| 1558 | async grabCheckedElementStatus(locator, options = {}) { |
| 1559 | const supportedTypes = ['checkbox', 'radio'] |
| 1560 | const el = await this._locateElement(locator) |
| 1561 | const type = await el.getAttribute('type') |
| 1562 | |
| 1563 | if (supportedTypes.includes(type)) { |
| 1564 | return el.isChecked(options) |
| 1565 | } |
| 1566 | throw new Error(`Element is not a ${supportedTypes.join(' or ')} input`) |
| 1567 | } |
| 1568 | /** |
| 1569 | * Return the disabled status of given element. |
| 1570 | * |
no test coverage detected