-
Notifications
You must be signed in to change notification settings - Fork 47
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
4952 + 4964: Angular grid list class implementation and refactoring tests #5085
base: angular_rework_development
Are you sure you want to change the base?
4952 + 4964: Angular grid list class implementation and refactoring tests #5085
Conversation
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/GridListAssert.java
Outdated
Show resolved
Hide resolved
520353e
to
f2f26c5
Compare
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/GridList.java
Outdated
Show resolved
Hide resolved
…s_implementation # Conflicts: # jdi-light-angular-tests/src/main/java/io/github/com/StaticSite.java
and moved to common folder with gridList Tests updated basic grid list removed from tests
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/gridlist/GridTileAssert.java
Show resolved
Hide resolved
...ght-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/gridlist/GridList.java
Outdated
Show resolved
Hide resolved
...ght-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/gridlist/GridTile.java
Show resolved
Hide resolved
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/gridlist/GridListAssert.java
Show resolved
Hide resolved
...ght-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/gridlist/GridList.java
Outdated
Show resolved
Hide resolved
...angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/GridListTests.java
Show resolved
Hide resolved
...ght-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/gridlist/GridList.java
Show resolved
Hide resolved
...ght-angular/src/main/java/com/epam/jdi/light/angular/elements/complex/gridlist/GridTile.java
Outdated
Show resolved
Hide resolved
@JDIAction("Assert that '{name}' has number of columns '{0}'") | ||
public GridListAssert cols(int expectedCols) { | ||
jdiAssert(element().cols(), Matchers.is(expectedCols), | ||
String.format("\nActual number of columns in Grid List: '%s'\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
стандартное сообщение матчера нормальное, к нему все привыкли
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/asserts/gridlist/GridListAssert.java
Outdated
Show resolved
Hide resolved
*/ | ||
@JDIAction(value = "Assert that '{name}' is empty", isAssert = true) | ||
public GridListAssert empty() { | ||
jdiAssert(element().tiles().isEmpty(), Matchers.is(true), "List is not empty"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- есть матчер для пустой коллекции
- сообщение List is not empty не понятно, какой такой лист? мы tile проверяем, вот и написать, что tile есть или нет
*/ | ||
@JDIAction("Assert that each of '{name}' elements meet condition") | ||
public GridListAssert each(JFunc1<GridTile, Boolean> condition) { | ||
jdiAssert(LinqUtils.all(element().tiles(), condition::execute), Matchers.is(true), "Not all elements meet condition"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я может что-то не поняла, а почему мы не используем Matcher.allOf и с матчером внутри?
сообщение, что не все элементы невозможно потом понять, потому что инфа, что собственно не прошло, теряется, зачем перебивать сообщение об ошибке родное? и делать его нечитаемым?
.and().gutterSize("10px") | ||
.and().notEmpty() | ||
.and().size(4) | ||
.each(ICoreElement::isVisible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
стиль кода поехал, давайте единообразно писать
...angular-tests/src/test/java/io/github/epam/angular/tests/elements/complex/GridListTests.java
Outdated
Show resolved
Hide resolved
.and().colspan(1) | ||
.and().rowspan(2); | ||
|
||
dynamicGridList.tileByIndex(2).find(".avatar-img").is() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не надо вот такое писать, кастомный локатор в тесте - плохая практика, мы тут пытаемся показать, как это используется правильно.
правильный метод - сделать кастомный tile с валидатором
…erts/gridlist/GridListAssert.java Co-authored-by: Natalia Pozhidaeva <[email protected]>
…ests/elements/complex/GridListTests.java Co-authored-by: Natalia Pozhidaeva <[email protected]>
…tation' into angular_grid_list_class_implementation
public class CustomGridTileWithImage extends GridTile { | ||
|
||
@UI("#dynamic-grid-item-avatar") | ||
public UIElement image; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я скоро добавлю в checkstyle условие, чтобы никто не писал, что image имеет тип UIElement
"У нас есть enum для цветов, надо для него тоже assert сделать" - добавить использование
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java