#4942 refactoring: Snackbar element#5534
#4942 refactoring: Snackbar element#5534spbqaru wants to merge 12 commits intoangular_rework_developmentfrom
Conversation
- Update test site: Snackbar element
| protected String messageLocator = "./span"; | ||
|
|
||
| public class Snackbar extends UIBaseElement<SnackbarAssert> implements HasPosition { | ||
| @Deprecated |
There was a problem hiding this comment.
пакет не релизился, ничего не надо depricated, просто удаляем
| action.click(); | ||
| } | ||
|
|
||
| @JDIAction("Click '{name}' action") |
There was a problem hiding this comment.
message не соответсвует действию
|
|
||
| @JDIAction("Click '{name}' action") | ||
| public UIElement actionIcon() { | ||
| return this.action; |
|
|
||
| @Override | ||
| public Position position() { | ||
| return null; |
| * @param element UIElement to check | ||
| * @return position as {@link Position} | ||
| */ | ||
| default Position getPositionFromClass(UIElement element, String className) { |
There was a problem hiding this comment.
методы выглядят как статические, мы передаем элемент сами и класс тоже, никаких дефолтов даже нет
There was a problem hiding this comment.
не понимаю смысла переопределения этого метода. У нас интерфейс, который говорит, что вот у этого элемента есть позиция, зачем вот этот метод мы должны переопределять, когда нас только текущая позиция интересует
There was a problem hiding this comment.
getPositionFromClass не надо переопределять,
getPositionFromAttribute - надо потому что берется позиция от родительского div
- Update test site: Snackbar element
- Update test site: Snackbar element
- 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) { |
There was a problem hiding this comment.
не понимаю смысла переопределения этого метода. У нас интерфейс, который говорит, что вот у этого элемента есть позиция, зачем вот этот метод мы должны переопределять, когда нас только текущая позиция интересует
| LEFT("justify-content: flex-start"), | ||
| RIGHT("justify-content: flex-end"), | ||
|
|
||
| CENTER_BOTTOM("justify-content: center; align-items: flex-end;"), |
There was a problem hiding this comment.
а если стили в другом порядке стоять будут, то все?
There was a problem hiding this comment.
обновил Position enum
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
- Update test site: Snackbar element
| * Each constant includes information about its string representation. | ||
| */ | ||
| public enum Position { | ||
| TOP(null, "align-items: flex-start;"), |
There was a problem hiding this comment.
все зафейлится, если значение будет последним в стиле
| return position; | ||
| } | ||
| } | ||
| throw runtimeException(String.format("No appropriate %s constant found for value '%s'", Position.class.getName(), text)); |
There was a problem hiding this comment.
это потом везде ловить это исключение нужно, не удобно. лучше завести значение типа UNKNOWN и его возвращать, когда ничего не нашлось
| if (StringUtils.isBlank(text)) { | ||
| throw runtimeException(String.format("%s: input string can't be empty", Position.class.getName())); | ||
| } | ||
| boolean horizontalPositionMatches = containsIgnoreCase(text, justifyContent); |
There was a problem hiding this comment.
а почему нельзя взять css("justify-content") css("align-items") и их комбинировать и не парится, что там у нас в стиле с чем совпало?
Uh oh!
There was an error while loading. Please reload this page.