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

#5309 beautify chip #5427

Merged
merged 1 commit into from
Apr 7, 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 @@ -111,8 +111,7 @@ public void sizesChipTests() {
int expectedHeight = 16;
Chip sizeChip = sizesChips.get(1);
sizeChip.show();
sizeChip.has().fontSize(expectedFontSize)
.and().height(expectedHeight)
sizeChip.has().height(expectedHeight)
.and().xSmallSize();
sizesChips.get(2).has().smallSize();
sizesChips.get(3).has().defaultSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ public ChipAssert notLabel() {
return this;
}

// @todo #5048 Check if this method usefull
@JDIAction(value = "Assert that ''{name}' filter icon is displayed'", isAssert = true)
public ChipAssert filterIconDisplayed() {
jdiAssert(element().isFilterIconDisplayed(), Matchers.is(true),
jdiAssert(element().filter().isDisplayed(), Matchers.is(true),
"Chip's filter icon is not displayed");
return this;
}

@JDIAction(value = "Assert that ''{name}' filter icon is not displayed'", isAssert = true)
public ChipAssert filterIconNotDisplayed() {
jdiAssert(element().isFilterIconDisplayed(), Matchers.is(false),
jdiAssert(element().filter().isDisplayed(), Matchers.is(false),
"Chip's filter icon is displayed");
return this;
}
Expand All @@ -92,12 +91,6 @@ public ChipAssert image() {
return this;
}

@JDIAction(value = "Assert that '{name}' font size is equal to '{0} px'", isAssert = true)
public ChipAssert fontSize(int fontSize) {
jdiAssert(element().fontSize(), Matchers.equalTo(fontSize));
return this;
}

@JDIAction(value = "Assert that '{name}' size is x-small", isAssert = true)
public ChipAssert xSmallSize() {
jdiAssert(element().hasXSmallSize(), Matchers.is(true), "Chip's size is not x-small");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ public boolean active() {
return core().hasClass("v-chip--active");
}

@JDIAction("Get if '{name}' filter icon is displayed")
public boolean isFilterIconDisplayed() {
return core().find(FILTER_LOCATOR).isDisplayed();
@JDIAction("Get '{name}' filter icon")
public UIElement filter() {
return core().find(FILTER_LOCATOR);
}

// "label" refers to specific element border radius settings
@JDIAction("Get if '{name}' is marked as label chip")
public boolean isLabel() {
return core().hasClass("v-chip--label");
Expand All @@ -77,11 +76,7 @@ public Image image() {
return new Image().setCore(Image.class, core().find(IMAGE_LOCATOR));
}

@JDIAction("Get '{name}' font size")
public int fontSize() {
return Integer.parseInt(core().css("font-size").replace("px", ""));
}

// @todo #5309 Ass interface for sizes (all small, x-small, default, large, x-large)
@JDIAction("Get if '{name}' hss x-small size")
public boolean hasXSmallSize() {
return core().hasClass("v-size--x-small");
Expand Down