(locator, context)
| 4370 | } |
| 4371 | |
| 4372 | async function findCheckable(locator, context) { |
| 4373 | let contextEl = await this.context |
| 4374 | if (typeof context === 'string') { |
| 4375 | contextEl = await findElements.call(this, contextEl, new Locator(context, 'css').simplify()) |
| 4376 | contextEl = contextEl[0] |
| 4377 | } |
| 4378 | |
| 4379 | // Handle role locators with text/exact options |
| 4380 | const roleElements = await handleRoleLocator(contextEl, locator) |
| 4381 | if (roleElements) return roleElements |
| 4382 | |
| 4383 | const matchedLocator = new Locator(locator) |
| 4384 | if (!matchedLocator.isFuzzy()) { |
| 4385 | return findElements.call(this, contextEl, matchedLocator) |
| 4386 | } |
| 4387 | |
| 4388 | const literal = xpathLocator.literal(matchedLocator.value) |
| 4389 | let els = await findElements.call(this, contextEl, Locator.checkable.byText(literal)) |
| 4390 | if (els.length) { |
| 4391 | return els |
| 4392 | } |
| 4393 | els = await findElements.call(this, contextEl, Locator.checkable.byName(literal)) |
| 4394 | if (els.length) { |
| 4395 | return els |
| 4396 | } |
| 4397 | return findElements.call(this, contextEl, matchedLocator.value) |
| 4398 | } |
| 4399 | |
| 4400 | async function proceedIsChecked(assertType, option) { |
| 4401 | let els = await findCheckable.call(this, option) |
nothing calls this directly
no test coverage detected