(locator, context = null)
| 3071 | } |
| 3072 | |
| 3073 | async function findFields(locator, context = null) { |
| 3074 | const locateFn = prepareLocateFn.call(this, context) |
| 3075 | locator = new Locator(locator) |
| 3076 | |
| 3077 | if (this._isCustomLocator(locator)) { |
| 3078 | return locateFn(locator) |
| 3079 | } |
| 3080 | |
| 3081 | if (locator.isAccessibilityId() && !this.isWeb) return locateFn(locator) |
| 3082 | if (locator.isRole()) return locateFn(locator) |
| 3083 | if (!locator.isFuzzy()) return locateFn(locator) |
| 3084 | |
| 3085 | const literal = xpathLocator.literal(locator.value) |
| 3086 | let els = await locateFn(Locator.field.labelEquals(literal)) |
| 3087 | if (els.length) return els |
| 3088 | |
| 3089 | els = await locateFn(Locator.field.labelContains(literal)) |
| 3090 | if (els.length) return els |
| 3091 | |
| 3092 | els = await locateFn(Locator.field.byName(literal)) |
| 3093 | if (els.length) return els |
| 3094 | |
| 3095 | return await locateFn(locator.value) // by css or xpath |
| 3096 | } |
| 3097 | |
| 3098 | async function proceedSeeField(assertType, field, value, context) { |
| 3099 | const res = await findFields.call(this, field, context) |
nothing calls this directly
no test coverage detected