Resolve "Генерация периодических задач по тегам" #207
@ -56,4 +56,25 @@ public class IndexConferenceTest extends TestTemplate {
|
||||
.stream()
|
||||
.anyMatch(webElement -> webElement.getText().equals(newConferenceName)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChangeConferenceNameAndSave() {
|
||||
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
||||
|
||||
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
||||
ConferencesPage conferencesPage = (ConferencesPage) getContext().initPage(page.getKey());
|
||||
ConferencePage conferencePage = (ConferencePage) getContext().initPage(Iterables.get(navigationHolder.entrySet(), 1).getKey());
|
||||
|
||||
conferencesPage.getConferenceFirst();
|
||||
String newConferenceName = "test " + (new Date()).getTime();
|
||||
conferencePage.clearName();
|
||||
conferencePage.setName(newConferenceName);
|
||||
conferencePage.clickSaveBut();
|
||||
|
||||
Assert.assertTrue(conferencesPage.getConferencesList()
|
||||
.stream()
|
||||
.anyMatch(webElement -> webElement.getText().equals(newConferenceName)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,10 @@ public class ConferencePage extends PageObject {
|
||||
driver.findElement(By.id("title")).sendKeys(name);
|
||||
}
|
||||
|
||||
public void clearName() {
|
||||
driver.findElement(By.id("title")).clear();
|
||||
}
|
||||
|
||||
public void clickSaveBut() {
|
||||
driver.findElement(By.id("send-message-button")).click();
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ public class ConferencesPage extends PageObject {
|
||||
|
||||
public List<WebElement> getConferencesList() {
|
||||
return driver.findElements(By.cssSelector("span.h6.float-left.m-2"));
|
||||
}
|
||||
|
||||
public void getConferenceFirst() {
|
||||
driver.findElement(By.xpath("//*[@id=\"conferences\"]/div/div[2]/div[1]/div[1]/div/a")).click();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user