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

#4942 refactoring: Snackbar element #5534

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

Conversation

spbqaru
Copy link
Contributor

@spbqaru spbqaru commented Jun 11, 2024

  • refactoring: Snackbar element
  • Fix failing tests for Snackbar

- Update test site: Snackbar element
@spbqaru spbqaru changed the base branch from master to angular_rework_development June 11, 2024 12:56
@AlexeyGirin AlexeyGirin requested review from pnatashap and removed request for pnatashap June 11, 2024 13:03
protected String messageLocator = "./span";

public class Snackbar extends UIBaseElement<SnackbarAssert> implements HasPosition {
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

пакет не релизился, ничего не надо depricated, просто удаляем

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@JDIAction("Click '{name}' action")
public void clickAction() {
action.click();
}

@JDIAction("Click '{name}' action")
Copy link
Contributor

Choose a reason for hiding this comment

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

message не соответсвует действию

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@JDIAction("Click '{name}' action")
public void clickAction() {
action.click();
}

@JDIAction("Click '{name}' action")
public UIElement actionIcon() {
return this.action;
Copy link
Contributor

Choose a reason for hiding this comment

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

а почему это icon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed


@Override
public Position position() {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

странная позиция

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

* @param element UIElement to check
* @return position as {@link Position}
*/
default Position getPositionFromClass(UIElement element, String className) {
Copy link
Contributor

Choose a reason for hiding this comment

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

методы выглядят как статические, мы передаем элемент сами и класс тоже, никаких дефолтов даже нет

Copy link
Contributor Author

Choose a reason for hiding this comment

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

overridden

Copy link
Contributor

Choose a reason for hiding this comment

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

не понимаю смысла переопределения этого метода. У нас интерфейс, который говорит, что вот у этого элемента есть позиция, зачем вот этот метод мы должны переопределять, когда нас только текущая позиция интересует

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getPositionFromClass не надо переопределять,
getPositionFromAttribute - надо потому что берется позиция от родительского div

@AlexeyGirin AlexeyGirin changed the title 4942 refactoring: Snackbar element #4942 refactoring: Snackbar element Jun 12, 2024
@spbqaru spbqaru linked an issue Jun 12, 2024 that may be closed by this pull request
3 tasks
Aleksandr_Vorobev added 2 commits June 13, 2024 04:07
- Update test site: Snackbar element
- Update test site: Snackbar element
@spbqaru spbqaru requested a review from pnatashap June 13, 2024 01:10
Aleksandr_Vorobev added 3 commits June 13, 2024 04:12
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
* @param element UIElement to check
* @return position as {@link Position}
*/
default Position getPositionFromClass(UIElement element, String className) {
Copy link
Contributor

Choose a reason for hiding this comment

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

не понимаю смысла переопределения этого метода. У нас интерфейс, который говорит, что вот у этого элемента есть позиция, зачем вот этот метод мы должны переопределять, когда нас только текущая позиция интересует

LEFT("justify-content: flex-start"),
RIGHT("justify-content: flex-end"),

CENTER_BOTTOM("justify-content: center; align-items: flex-end;"),
Copy link
Contributor

Choose a reason for hiding this comment

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

а если стили в другом порядке стоять будут, то все?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

обновил Position enum

Aleksandr_Vorobev added 4 commits June 21, 2024 18:16
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
@spbqaru spbqaru requested a review from pnatashap June 24, 2024 17:17
Aleksandr_Vorobev added 2 commits June 28, 2024 19:35
- Update test site: Snackbar element
@spbqaru spbqaru requested a review from vklonin June 29, 2024 10:58
@spbqaru spbqaru requested review from pnatashap and removed request for pnatashap July 16, 2024 13:04
* Each constant includes information about its string representation.
*/
public enum Position {
TOP(null, "align-items: flex-start;"),
Copy link
Contributor

Choose a reason for hiding this comment

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

все зафейлится, если значение будет последним в стиле

return position;
}
}
throw runtimeException(String.format("No appropriate %s constant found for value '%s'", Position.class.getName(), text));
Copy link
Contributor

Choose a reason for hiding this comment

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

это потом везде ловить это исключение нужно, не удобно. лучше завести значение типа UNKNOWN и его возвращать, когда ничего не нашлось

if (StringUtils.isBlank(text)) {
throw runtimeException(String.format("%s: input string can't be empty", Position.class.getName()));
}
boolean horizontalPositionMatches = containsIgnoreCase(text, justifyContent);
Copy link
Contributor

Choose a reason for hiding this comment

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

а почему нельзя взять css("justify-content") css("align-items") и их комбинировать и не парится, что там у нас в стиле с чем совпало?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests refactoring: Snackbar element
2 participants