-
Notifications
You must be signed in to change notification settings - Fork 48
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
5378 Fix failing tests for Snackbar #5379
base: angular_rework_development
Are you sure you want to change the base?
Changes from 6 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,44 +4,30 @@ | |
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; | ||
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 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 = ".mdc-snackbar__label"; | ||
|
||
protected UIElement action; | ||
public Button actionButton; | ||
protected String actionLocator = ".//button"; | ||
|
||
public Snackbar() { | ||
message = new UIElement(); | ||
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. А зачем нам эти элементы хранить? 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. После введения проверок из элемента 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.core().setLocator(actionLocator); | ||
actionButton = new Button(); | ||
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. кнопок технически можно сделать несколько, надо предусмотреть возможность с ними работать 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. У элементов 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. Конструктор убрал из |
||
actionButton.core().setLocator(actionLocator); | ||
} | ||
|
||
@JDIAction("Get '{name}' message") | ||
public String getMessageText() { | ||
return message.getValue(); | ||
} | ||
|
||
@JDIAction("Get '{name}' action") | ||
public String getActionText() { | ||
return action.getValue(); | ||
} | ||
|
||
@JDIAction("Click '{name}' action") | ||
public void clickAction() { | ||
action.click(); | ||
} | ||
|
||
@JDIAction("Is '{name}' action displayed") | ||
public boolean isActionDisplayed() { | ||
return action.isDisplayed(); | ||
public String messageText() { | ||
return message.getText(); | ||
} | ||
|
||
@Override | ||
|
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)