Skip to content

Commit

Permalink
Merge pull request #5472 from jdi-testing/5420
Browse files Browse the repository at this point in the history
#5420 add HasRounded to Autocomplete
  • Loading branch information
pnatashap authored Apr 16, 2024
2 parents 3122b3a + 6bc0a38 commit 50fcda8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.elements.interfaces.common.IsText;
import com.epam.jdi.light.vuetify.elements.complex.Autocomplete;
import com.epam.jdi.light.vuetify.interfaces.asserts.DenseAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.FilledAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.OutlinedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ShapedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.*;
import org.hamcrest.Matchers;

import java.util.List;
Expand All @@ -19,6 +16,7 @@ public class AutocompleteAssert extends UIAssert<AutocompleteAssert, Autocomplet
implements FilledAssert<AutocompleteAssert, Autocomplete>,
OutlinedAssert<AutocompleteAssert, Autocomplete>,
DenseAssert<AutocompleteAssert, Autocomplete>,
RoundedAssert<AutocompleteAssert, Autocomplete>,
ShapedAssert<AutocompleteAssert, Autocomplete> {

@JDIAction(value = "Assert that '{name}' is expanded", isAssert = true)
Expand Down Expand Up @@ -89,16 +87,6 @@ public AutocompleteAssert solo() {
return this;
}

// @todo #5308 Create interface for rounded
@JDIAction(value = "Assert that 'name' has rounded style", isAssert = true)
public AutocompleteAssert rounded() {
jdiAssert(
element().root().attr("class"),
Matchers.containsString("v-text-field--rounded")
);
return this;
}

// @todo #5308 create interface for Themes
@JDIAction(value = "Assert that 'name' has dark style", isAssert = true)
public AutocompleteAssert dark() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
* https://v2.vuetifyjs.com/en/components/buttons/
*/

public class VuetifyButton extends Button implements HasClick, HasIcon, HasColor, HasTheme, HasElevation, IsOutlined,
public class VuetifyButton extends Button implements HasClick, HasIcon,
HasColor, HasTheme, HasElevation, IsOutlined,
HasMeasurement, HasRounded {

@UI(".v-btn__loader")
Expand Down Expand Up @@ -93,4 +94,9 @@ public VuetifyButtonAssert verify() {
return is();
}

@Override
public boolean isRounded() {
return core().attr("class").contains("v-btn--rounded");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
import com.epam.jdi.light.vuetify.annotations.JAutocomplete;
import com.epam.jdi.light.vuetify.asserts.AutocompleteAssert;
import com.epam.jdi.light.vuetify.elements.common.ListItem;
import com.epam.jdi.light.vuetify.interfaces.IsDense;
import com.epam.jdi.light.vuetify.interfaces.IsFilled;
import com.epam.jdi.light.vuetify.interfaces.IsOutlined;
import com.epam.jdi.light.vuetify.interfaces.IsShaped;
import com.epam.jdi.light.vuetify.interfaces.*;
import com.jdiai.tools.Timer;
import org.openqa.selenium.Keys;

Expand All @@ -30,7 +27,7 @@
*/

public class Autocomplete extends UIBaseElement<AutocompleteAssert>
implements ISetup, IsFilled, IsOutlined, IsDense, IsShaped {
implements ISetup, IsFilled, IsOutlined, IsDense, IsShaped, HasRounded {
private static final String VALUE_LOCATOR = "div input[type='hidden']";
private static final String INPUT_LOCATOR = "div input[type='text']";
private static final String EXPAND_LOCATOR = "div .v-input__append-inner";
Expand Down Expand Up @@ -226,4 +223,9 @@ public void clickClear() {
public boolean isSolo() {
return root().attr("class").contains("v-text-field--solo");
}

@Override
public boolean isRounded() {
return root().attr("class").contains("v-text-field--rounded");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ public boolean isDisabled() {
return core().hasClass("v-list--disabled");
}

@Override
@JDIAction("Get if '{name}' is enabled")
public boolean isEnabled() {
return !this.isDisabled();
}

@Override
@JDIAction("Get if '{name}' is rounded")
public boolean isRounded() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Interface <code>HasRounded</code> includes methods to check that element is rounded.
*/
// @todo #5420 Check the all classes has this class if can be rounded
public interface HasRounded extends ICoreElement {

String ROUNDED_PATTERN = "rounded?[^-0][\\S]*";
Expand Down

0 comments on commit 50fcda8

Please sign in to comment.