-
Notifications
You must be signed in to change notification settings - Fork 47
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 1 commit
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 |
---|---|---|
|
@@ -2,68 +2,66 @@ | |
|
||
import com.jdiai.tools.func.JAction; | ||
import io.github.epam.TestsInit; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Ignore; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import static io.github.com.StaticSite.angularPage; | ||
import static io.github.com.pages.AngularPage.snackbarSection; | ||
import static io.github.epam.site.steps.States.shouldBeLoggedIn; | ||
import static com.jdiai.tools.Timer.waitCondition; | ||
import static io.github.com.StaticSite.snackBarPage; | ||
|
||
|
||
// TODO Move to the new page | ||
@Ignore | ||
public class SnackbarTests extends TestsInit { | ||
|
||
private static final String MESSAGE = "Test Message"; | ||
private static final String ACTION = "Test Action"; | ||
|
||
@BeforeMethod | ||
@BeforeClass | ||
public void before() { | ||
shouldBeLoggedIn(); | ||
angularPage.shouldBeOpened(); | ||
snackBarPage.open(); | ||
waitCondition(() -> snackBarPage.isOpened()); | ||
snackBarPage.checkOpened(); | ||
} | ||
|
||
@Test | ||
public void checkBasicSnackbarTest() { | ||
snackbarSection.messageInput.setValue(MESSAGE); | ||
snackbarSection.actionInput.setValue(ACTION); | ||
snackbarSection.openButton.click(); | ||
snackBarPage.messageInput.setValue(MESSAGE); | ||
snackBarPage.actionInput.setValue(ACTION); | ||
snackBarPage.openButton.click(); | ||
|
||
snackbarSection.basicSnackbar.is().displayed(); | ||
snackbarSection.basicSnackbar.has().message(MESSAGE); | ||
snackbarSection.basicSnackbar.has().action(ACTION); | ||
snackBarPage.basicSnackbar.is().displayed(); | ||
snackBarPage.basicSnackbar.has().message(MESSAGE); | ||
snackBarPage.basicSnackbar.has().action(ACTION); | ||
} | ||
|
||
@Test | ||
public void checkSnackbarClickActionDismissTest() { | ||
snackbarSection.messageInput.setValue(MESSAGE); | ||
snackbarSection.actionInput.setValue(ACTION); | ||
snackbarSection.openButton.click(); | ||
snackBarPage.messageInput.setValue(MESSAGE); | ||
snackBarPage.actionInput.setValue(ACTION); | ||
snackBarPage.openButton.click(); | ||
|
||
snackbarSection.basicSnackbar.clickAction(); | ||
snackbarSection.basicSnackbar.is().disappear(); | ||
snackBarPage.basicSnackbar.clickAction(); | ||
snackBarPage.basicSnackbar.is().disappear(); | ||
} | ||
|
||
@Test | ||
public void checkSnackbarWithNoActionTest() { | ||
snackbarSection.messageInput.setValue(MESSAGE); | ||
snackbarSection.actionInput.setValue(""); | ||
snackbarSection.openButton.click(); | ||
snackBarPage.messageInput.setValue(MESSAGE); | ||
snackBarPage.actionInput.setValue(""); | ||
snackBarPage.openButton.click(); | ||
|
||
snackbarSection.basicSnackbar.has().action(); | ||
snackBarPage.basicSnackbar.has().action(); | ||
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. тест про NO ACTION TEST 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. Переименовал. Теперь эта строчка выглядит так |
||
} | ||
|
||
@Test | ||
public void checkSnackbarDurationTest() { | ||
final int DURATION = 5; | ||
|
||
JAction action = () -> { | ||
snackbarSection.customSnackbar.base().timer().wait(() -> snackbarSection.customSnackbar.isDisplayed()); | ||
snackbarSection.customSnackbar.base().timer().wait(() -> snackbarSection.customSnackbar.isHidden()); | ||
snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isDisplayed()); | ||
snackBarPage.customSnackbar.base().timer().wait(() -> snackBarPage.customSnackbar.isHidden()); | ||
}; | ||
|
||
snackbarSection.durationInput.setValue(String.valueOf(DURATION)); | ||
snackbarSection.customSnackbarOpenButton.click(); | ||
snackBarPage.durationInput.setValue(String.valueOf(DURATION)); | ||
snackBarPage.customSnackbarOpenButton.click(); | ||
|
||
//duration(DURATION, 1000, action); | ||
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. Сделано |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
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 = "//*[@matsnackbarlabel]"; | ||
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 гораздо более понятнее смотрится 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; | ||
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. это кнопка, а не 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 actionLocator = ".//button"; | ||
|
@@ -26,7 +26,7 @@ public Snackbar() { | |
|
||
@JDIAction("Get '{name}' message") | ||
public String getMessageText() { | ||
igor-korost marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return message.getValue(); | ||
return message.getText(); | ||
} | ||
|
||
@JDIAction("Get '{name}' action") | ||
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. Переименовал |
||
|
Uh oh!
There was an error while loading. Please reload this page.