Skip to content

4952 + 4964: Angular grid list class implementation and refactoring tests#5085

Open
b14ckster wants to merge 37 commits intoangular_rework_developmentfrom
angular_grid_list_class_implementation
Open

4952 + 4964: Angular grid list class implementation and refactoring tests#5085
b14ckster wants to merge 37 commits intoangular_rework_developmentfrom
angular_grid_list_class_implementation

Conversation

@b14ckster
Copy link
Copy Markdown
Contributor

@b14ckster b14ckster commented Sep 27, 2023

"У нас есть enum для цветов, надо для него тоже assert сделать" - добавить использование
jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/enums/AngularColors.java

@b14ckster b14ckster force-pushed the angular_grid_list_class_implementation branch from 520353e to f2f26c5 Compare October 13, 2023 15:00
@MayaElf MayaElf changed the title 4952 + 4964: Angular grid list class implementation and refactoring tests [WIP]4952 + 4964: Angular grid list class implementation and refactoring tests Oct 18, 2023
…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
@vklonin vklonin requested a review from pnatashap February 8, 2024 16:47
@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" +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стандартное сообщение матчера нормальное, к нему все привыкли

*/
@JDIAction(value = "Assert that '{name}' is empty", isAssert = true)
public GridListAssert empty() {
jdiAssert(element().tiles().isEmpty(), Matchers.is(true), "List is not empty");
Copy link
Copy Markdown
Contributor

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");
Copy link
Copy Markdown
Contributor

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стиль кода поехал, давайте единообразно писать

.and().colspan(1)
.and().rowspan(2);

dynamicGridList.tileByIndex(2).find(".avatar-img").is()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не надо вот такое писать, кастомный локатор в тесте - плохая практика, мы тут пытаемся показать, как это используется правильно.
правильный метод - сделать кастомный tile с валидатором

vklonin and others added 4 commits February 9, 2024 09:29
…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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я скоро добавлю в checkstyle условие, чтобы никто не писал, что image имеет тип UIElement

@vklonin vklonin self-requested a review February 14, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create class implementing angular element Grid list Tests refactoring: grid list element

7 participants