Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5420 add HasRounded to Autocomplete #5472

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading