#103 add delete deadline

This commit is contained in:
Nightblade73 2019-05-10 17:40:24 +04:00
parent 0cb7b05c25
commit 7b4318a3b5
2 changed files with 24 additions and 0 deletions

View File

@ -127,4 +127,24 @@ public class IndexConferenceTest extends TestTemplate {
Assert.assertTrue(membersCount + 1 == conferencePage.getMemperCount()
&& conferencePage.getTakePartButDisabledValue().equals("true"));
}
@Test
public void testDeleteDeadlineAndSave() {
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 conferenceId = conferencePage.getId();
Integer deadlineCount = conferencePage.getDeadlineCount();
conferencePage.clickDeleteDeadlineBut();
conferencePage.clickSaveBut();
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
Assert.assertTrue(deadlineCount - 1 == conferencePage.getDeadlineCount());
}
}

View File

@ -63,4 +63,8 @@ public class ConferencePage extends PageObject {
public Integer getMemperCount() {
return driver.findElements(By.className("member")).size();
}
public void clickDeleteDeadlineBut() {
driver.findElement(By.xpath("//*[@id=\"deadlines\"]/div/input[4]")).click();
}
}