Skip to content
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

Open
wants to merge 37 commits into
base: angular_rework_development
Choose a base branch
from

Conversation

b14ckster
Copy link
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
@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
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
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
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
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
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
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
No open projects
JDI Light Board
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

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