(locator, locateFn)
| 3037 | } |
| 3038 | |
| 3039 | async function findClickable(locator, locateFn) { |
| 3040 | locator = new Locator(locator) |
| 3041 | |
| 3042 | if (this._isCustomLocator(locator)) { |
| 3043 | return locateFn(locator.value) |
| 3044 | } |
| 3045 | |
| 3046 | if (locator.isAccessibilityId() && !this.isWeb) return locateFn(locator, true) |
| 3047 | if (locator.isRole()) return locateFn(locator, true) |
| 3048 | if (!locator.isFuzzy()) return locateFn(locator, true) |
| 3049 | |
| 3050 | let els |
| 3051 | const literal = xpathLocator.literal(locator.value) |
| 3052 | |
| 3053 | els = await locateFn(Locator.clickable.narrow(literal)) |
| 3054 | if (els.length) return els |
| 3055 | |
| 3056 | // Try ARIA selector for accessible name |
| 3057 | try { |
| 3058 | els = await locateFn(`aria/${locator.value}`) |
| 3059 | if (els.length) return els |
| 3060 | } catch (e) { |
| 3061 | // ARIA selector not supported or failed |
| 3062 | } |
| 3063 | |
| 3064 | els = await locateFn(Locator.clickable.wide(literal)) |
| 3065 | if (els.length) return els |
| 3066 | |
| 3067 | els = await locateFn(Locator.clickable.self(literal)) |
| 3068 | if (els.length) return els |
| 3069 | |
| 3070 | return await locateFn(locator.value) // by css or xpath |
| 3071 | } |
| 3072 | |
| 3073 | async function findFields(locator, context = null) { |
| 3074 | const locateFn = prepareLocateFn.call(this, context) |
nothing calls this directly
no test coverage detected