From 1f83145a810a3fe01cb7943826bcffc26756330f Mon Sep 17 00:00:00 2001 From: Natalia Pozhidaeva Date: Tue, 16 Apr 2024 20:22:20 -0500 Subject: [PATCH] #5474 add isEnabled implementation --- .../epam/jdi/light/material/elements/inputs/Switch.java | 6 ++++++ .../com/epam/jdi/light/vuetify/elements/common/Input.java | 6 ++++++ .../jdi/light/vuetify/elements/complex/Autocomplete.java | 7 +++++++ .../epam/jdi/light/vuetify/elements/complex/FileInput.java | 6 ++++++ .../jdi/light/vuetify/elements/complex/TimePicker.java | 7 +++++++ .../vuetify/elements/complex/radiobuttons/RadioButton.java | 6 ++++++ 6 files changed, 38 insertions(+) diff --git a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/elements/inputs/Switch.java b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/elements/inputs/Switch.java index 14f9b7f080..174ff49b43 100644 --- a/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/elements/inputs/Switch.java +++ b/jdi-light-material-ui/src/main/java/com/epam/jdi/light/material/elements/inputs/Switch.java @@ -76,6 +76,12 @@ public boolean isDisabled() { return containsDisabled(); } + @JDIAction("Check that '{name}' is enabled") + @Override + public boolean isEnabled() { + return !this.isDisabled(); + } + @Override public SwitchAssert is() { return new SwitchAssert().set(this); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/common/Input.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/common/Input.java index 2689c44e1d..8149c1bc21 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/common/Input.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/common/Input.java @@ -83,6 +83,12 @@ public boolean isDisabled() { return core().hasClass("v-input--is-disabled"); } + @Override + @JDIAction("Get if '{name}' is enabled") + public boolean isEnabled() { + return !this.isDisabled(); + } + @JDIAction("Get if '{name}' has input field") public boolean hasInputField() { return input().isExist(); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Autocomplete.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Autocomplete.java index cc3c59706f..be0b4de296 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Autocomplete.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/Autocomplete.java @@ -192,11 +192,18 @@ public List selected() { return Arrays.asList(value().attr("value").split(",")); } + @Override @JDIAction("Get if '{name}' is disabled") public boolean isDisabled() { return input().hasAttribute("disabled"); } + @Override + @JDIAction("Get if '{name}' is enabled") + public boolean isEnabled() { + return !this.isDisabled(); + } + @JDIAction("Type text in the {name}'s text field") public void typeText(String value) { input().clear(); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/FileInput.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/FileInput.java index 1833625b76..456fb0495b 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/FileInput.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/FileInput.java @@ -67,6 +67,12 @@ public boolean isDisabled() { return core().hasClass("v-input--is-disabled"); } + @Override + @JDIAction("Get if '{name}' is enabled") + public boolean isEnabled() { + return !this.isDisabled(); + } + @JDIAction("Get '{name}' files list") public WebList files() { return core().finds(filesLocator); diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TimePicker.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TimePicker.java index cc51c23fc9..653aa0040a 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TimePicker.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/TimePicker.java @@ -442,6 +442,7 @@ public boolean isReadOnly() { /** * @return Check if TimePicker is disabled */ + @Override @JDIAction("Check that '{name}' is disabled") public boolean isDisabled() { return core().finds(TITLE_BUTTONS_ALL).stream() @@ -450,6 +451,12 @@ && core().finds(CLOCK_NUMBERS).stream() .allMatch(el -> el.attr("class").contains("--disabled")); } + @Override + @JDIAction("Check that '{name}' is enabled") + public boolean isEnabled() { + return !this.isDisabled(); + } + /** * @return Return title background color as hex {@link String} */ diff --git a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/radiobuttons/RadioButton.java b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/radiobuttons/RadioButton.java index 86a59dbf67..29ac4bc93d 100644 --- a/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/radiobuttons/RadioButton.java +++ b/jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/elements/complex/radiobuttons/RadioButton.java @@ -34,6 +34,12 @@ public boolean isDisabled() { return core().hasClass("v-radio--is-disabled"); } + @Override + @JDIAction("Get if '{name}' is enabled") + public boolean isEnabled() { + return !this.isDisabled(); + } + @Override @JDIAction("Get '{name}' theme") public String theme() {