4952 + 4964: Angular grid list class implementation and refactoring tests#5085
4952 + 4964: Angular grid list class implementation and refactoring tests#5085b14ckster wants to merge 37 commits intoangular_rework_developmentfrom
Conversation
520353e to
f2f26c5
Compare
…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
| @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.
стандартное сообщение матчера нормальное, к нему все привыкли
| */ | ||
| @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.
- есть матчер для пустой коллекции
- сообщение 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.
я может что-то не поняла, а почему мы не используем Matcher.allOf и с матчером внутри?
сообщение, что не все элементы невозможно потом понять, потому что инфа, что собственно не прошло, теряется, зачем перебивать сообщение об ошибке родное? и делать его нечитаемым?
| .and().gutterSize("10px") | ||
| .and().notEmpty() | ||
| .and().size(4) | ||
| .each(ICoreElement::isVisible) |
There was a problem hiding this comment.
стиль кода поехал, давайте единообразно писать
| .and().colspan(1) | ||
| .and().rowspan(2); | ||
|
|
||
| dynamicGridList.tileByIndex(2).find(".avatar-img").is() |
There was a problem hiding this comment.
не надо вот такое писать, кастомный локатор в тесте - плохая практика, мы тут пытаемся показать, как это используется правильно.
правильный метод - сделать кастомный tile с валидатором
…erts/gridlist/GridListAssert.java Co-authored-by: Natalia Pozhidaeva <Natalia_Pozhidaeva@epam.com>
…ests/elements/complex/GridListTests.java Co-authored-by: Natalia Pozhidaeva <Natalia_Pozhidaeva@epam.com>
…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.
я скоро добавлю в checkstyle условие, чтобы никто не писал, что image имеет тип UIElement
"У нас есть enum для цветов, надо для него тоже assert сделать" - добавить использование
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java