From e7b67eb5234587be6efc42dc5157f5cc3b5fc63f Mon Sep 17 00:00:00 2001 From: Luc Gagan Date: Sat, 11 Nov 2023 22:01:52 -0600 Subject: [PATCH] feat: add locator.isEnabled --- README.md | 1 + src/completeTask.ts | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index b74de9d..cca0a9c 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ Certainly! Here's a rephrased version of the provided content, presented in a ma - `locator.innerText` - `locator.inputValue` - `locator.isChecked` +- `locator.isEnabled` - `locator.isVisible` - `locator.uncheck` - `page.goto` diff --git a/src/completeTask.ts b/src/completeTask.ts index 134fd15..163b360 100644 --- a/src/completeTask.ts +++ b/src/completeTask.ts @@ -272,6 +272,28 @@ export const completeTask = async ( }, }, }, + { + function: async (args: { elementId: string }) => { + return { isEnabled: await getLocator(args.elementId).isEnabled() }; + }, + name: "locator_isEnabled", + description: "Returns whether the element is enabled. Element is considered enabled unless it is a