-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Vlasiuk
committed
Nov 30, 2023
1 parent
05f1218
commit c058117
Showing
6 changed files
with
115 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerAssert.java
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
...ight-angular/src/main/java/com/epam/jdi/light/angular/asserts/DividerSeparatorAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.epam.jdi.light.angular.asserts; | ||
|
||
import com.epam.jdi.light.angular.elements.common.DividerSeparator; | ||
import com.epam.jdi.light.asserts.generic.UIAssert; | ||
import com.epam.jdi.light.common.JDIAction; | ||
import org.hamcrest.Matchers; | ||
|
||
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; | ||
|
||
/** | ||
* Assertions for {@link DividerSeparator} | ||
*/ | ||
public class DividerSeparatorAssert extends UIAssert<DividerSeparatorAssert, DividerSeparator> { | ||
|
||
/** | ||
* Check that {@link DividerSeparator} is horizontal orientation | ||
* | ||
* @return this {@link DividerSeparatorAssert} instance | ||
*/ | ||
@JDIAction("Assert that '{name}' is horizontal orientation") | ||
public DividerSeparatorAssert horizontal() { | ||
jdiAssert(element().isHorizontal() ? "is horizontal" : "is not horizontal", Matchers.is("is horizontal")); | ||
return this; | ||
} | ||
|
||
/** | ||
* Check that {@link DividerSeparator} is vertical orientation | ||
* | ||
* @return this {@link DividerSeparatorAssert} instance | ||
*/ | ||
@JDIAction("Assert that '{name}' is vertical orientation") | ||
public DividerSeparatorAssert vertical() { | ||
jdiAssert(element().isVertical() ? "is vertical" : "is not vertical", Matchers.is("is vertical")); | ||
return this; | ||
} | ||
|
||
/** | ||
* Check that {@link DividerSeparator} has inset | ||
* | ||
* @return this {@link DividerSeparatorAssert} instance | ||
*/ | ||
@JDIAction("Assert that '{name}' has inset") | ||
public DividerSeparatorAssert inset() { | ||
jdiAssert(element().hasInset() ? "has inset" : "has no inset", Matchers.is("has inset")); | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ht-angular/src/main/java/com/epam/jdi/light/angular/elements/common/DividerSeparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.epam.jdi.light.angular.elements.common; | ||
|
||
import com.epam.jdi.light.angular.asserts.DividerSeparatorAssert; | ||
import com.epam.jdi.light.common.JDIAction; | ||
import com.epam.jdi.light.elements.base.UIBaseElement; | ||
|
||
public class DividerSeparator extends UIBaseElement<DividerSeparatorAssert> { | ||
|
||
private static final String ORIENTATION_ATTRIBUTE = "aria-orientation"; | ||
private static final String HORIZONTAL_VALUE = "horizontal"; | ||
private static final String VERTICAL_VALUE = "vertical"; | ||
private static final String INSET_CLASS = "mat-divider-inset"; | ||
|
||
/** | ||
* Check whether Divider separator is horizontal orientation or not | ||
* | ||
* @return {@code true} if Divider separator is horizontal orientation | ||
*/ | ||
@JDIAction("Check if '{name}' is horizontal orientation") | ||
public boolean isHorizontal() { | ||
return core().attr(ORIENTATION_ATTRIBUTE).equals(HORIZONTAL_VALUE); | ||
} | ||
|
||
/** | ||
* Check whether Divider separator is vertical orientation or not | ||
* | ||
* @return {@code true} if Divider separator is vertical orientation | ||
*/ | ||
|
||
@JDIAction("Check if '{name}' is vertical orientation") | ||
public boolean isVertical() { | ||
return core().attr(ORIENTATION_ATTRIBUTE).equals(VERTICAL_VALUE); | ||
} | ||
|
||
/** | ||
* Check whether Divider separator has inset or not | ||
* | ||
* @return {@code true} if Divider separator has inset | ||
*/ | ||
@JDIAction("Check if '{name}' has inset") | ||
public boolean hasInset() { | ||
return core().hasClass(INSET_CLASS); | ||
} | ||
|
||
@Override | ||
public DividerSeparatorAssert is() { | ||
return new DividerSeparatorAssert().set(this); | ||
} | ||
|
||
@Override | ||
public DividerSeparatorAssert has() { | ||
return new DividerSeparatorAssert().set(this); | ||
} | ||
} |