Resolve "Генерация периодических задач по тегам" #207

Merged
ashette merged 32 commits from 79-students-tags-generation into dev 2019-05-16 07:30:47 +04:00
3 changed files with 28 additions and 0 deletions
Showing only changes of commit 1ad66d6fb1 - Show all commits

View File

@ -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)));
}
}

View File

@ -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();
}

View File

@ -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();
}
}