Skip to content

Commit

Permalink
4908 fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kira-vlsv committed Apr 17, 2024
1 parent 10fd2d1 commit 64851fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public void before() {
@Test
public void simpleFormFieldTest() {
simpleFormFieldInput.show();
simpleFormFieldTextarea.show();
simpleFormFieldSelect.show();
simpleFormFieldInput.has().label("Input");
simpleFormFieldTextarea.has().label("Textarea");
simpleFormFieldSelect.has().label("Select");
Expand All @@ -64,8 +62,6 @@ public void simpleFormFieldTest() {
@Test
public void formFieldWithLabelTest() {
formFieldWithLabelInputSimplePlaceholder.show();
formFieldWithLabelInputSimplePlaceholderAndLabel.show();
formFieldWithLabelSelect.show();
formFieldWithLabelInputSimplePlaceholder.has().placeholder("Simple placeholder");
formFieldWithLabelInputSimplePlaceholderAndLabel.has().placeholder("Simple placeholder");
formFieldWithLabelInputSimplePlaceholderAndLabel.has().label("Both a label and a placeholder");
Expand Down Expand Up @@ -135,7 +131,6 @@ public void formFieldsThemesTest() {
@Test
public void formFieldsRequiredTest() {
formFieldWithLabelSelect.show();
hideRequiredMarker.show();
formFieldWithLabelSelect.is().required();
hideRequiredMarker.click();
formFieldWithLabelSelect.is().notRequired();
Expand All @@ -144,7 +139,6 @@ public void formFieldsRequiredTest() {
@Test
public void formFieldsFloatLabelTest() {
formFieldWithLabelSelect.show();
alwaysFloatLabel.show();
alwaysFloatLabel.click();
formFieldWithLabelSelect.has().alwaysFloatLabel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,15 @@ default String error() {
return core().find(By.cssSelector("mat-error")).getText();
}

@JDIAction("Click icon in '{name}'")
default void clickIcon() {
@JDIAction("Get icon with '{name}'")
default UIElement icon() {
WebElement element = core().find(By.xpath("//mat-icon/ancestor::button"));
UIElement actualElement = new UIElement(element);
actualElement.click();
}

@JDIAction("Get mat-icon text in '{name}'")
default String icon() {
WebElement element = core().find(By.cssSelector("mat-icon"));
UIElement actualElement = new UIElement(element);
return actualElement.getText();
}

@JDIAction("Get appearance attribute in '{name}'")
default String appearance() {
return core().attr("appearance");
return new UIElement(element);
}

@JDIAction("Check if '{name}' is required")
default boolean isRequired() {
return core().find(By.cssSelector("span")).attr("class").contains("mat-mdc-form-field-required-marker");
return core().find(By.cssSelector("span.mat-mdc-form-field-required-marker")).isExist();
}

@JDIAction("Check if '{name}' has always float label")
Expand All @@ -65,13 +52,13 @@ default boolean hasAlwaysFloatLabel() {
}

@Override
@JDIAction("Check if '{name}' is disabled")
default boolean isDisabled() {
@JDIAction("Check if '{name}' is enabled")
default boolean isEnabled() {
return core().attr("class").contains("mat-form-field-disabled");
}

@JDIAction("Check if select field '{name}' has dynamic subscriptSizing")
default boolean isDynamicSubscriptSizing() {
return !core().finds("//div[contains(@class,'mat-mdc-form-field-subscript-dynamic-size')]").getWebElements().isEmpty();
return core().find("//div[contains(@class,'mat-mdc-form-field-subscript-dynamic-size')]").isExist();
}
}

0 comments on commit 64851fb

Please sign in to comment.