-
Notifications
You must be signed in to change notification settings - Fork 48
5378 Fix failing tests for Snackbar #5379
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
base: angular_rework_development
Are you sure you want to change the base?
Changes from 4 commits
bffd263
5bcaab1
952c65c
234d252
c501379
16c6929
e919568
1057f50
90b4fe2
3058d29
c6e5fb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,33 +4,34 @@ | |
| import com.epam.jdi.light.common.JDIAction; | ||
| import com.epam.jdi.light.elements.base.UIBaseElement; | ||
| import com.epam.jdi.light.elements.common.UIElement; | ||
| import com.epam.jdi.light.ui.html.elements.common.Button; | ||
|
|
||
| /** | ||
| * To see an example of Snackbar web element please visit https://material.angular.io/components/snack-bar/overview. | ||
| */ | ||
|
|
||
| public class Snackbar extends UIBaseElement<SnackbarAssert> { | ||
| protected UIElement message; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. если message это элемент с текстом, то это должен быть не UIElement
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Заменил на |
||
| protected String messageLocator = "./span"; | ||
| protected String messageLocator = "//*[@matsnackbarlabel]"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. стиль mdc-snackbar__label гораздо более понятнее смотрится
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Пофиксил. Теперь так |
||
|
|
||
| protected UIElement action; | ||
| protected String actionLocator = ".//button"; | ||
| public Button action; | ||
|
vklonin marked this conversation as resolved.
Outdated
|
||
| protected String actionLocator = "//button"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а было правильно
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Вернул назад |
||
|
|
||
| public Snackbar() { | ||
| message = new UIElement(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А зачем нам эти элементы хранить?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. После введения проверок из элемента
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. вопрос был зачем это делать в конструкторе, а не так же, как это сделано в остальных элементах |
||
| message.core().setLocator(messageLocator); | ||
|
|
||
| action = new UIElement(); | ||
| action = new Button(); | ||
| action.core().setLocator(actionLocator); | ||
| } | ||
|
|
||
| @JDIAction("Get '{name}' message") | ||
| public String getMessageText() { | ||
| return message.getValue(); | ||
| public String messageText() { | ||
| return message.getText(); | ||
| } | ||
|
|
||
| @JDIAction("Get '{name}' action") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. и ниже все методы тоже требуют переименования
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Переименовал |
||
| public String getActionText() { | ||
| public String actionText() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. на самом деле при наличии доступа к кнопки мы можем на ней и проверить, что с ней, на кнопке есть свои валидаторы
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Выполнено. Теперь во всех тестах |
||
| return action.getValue(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
на текст всегда ставим валидатор с матчером, чтобы не только на полное соответствие можно было проверить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Заменил на
Matchers.containsString(expected)