#103 delete conf test

This commit is contained in:
Nightblade73 2019-05-11 00:51:57 +04:00
parent 3f32a61ed2
commit b2e8a43cee
2 changed files with 23 additions and 0 deletions

View File

@ -255,4 +255,19 @@ public class IndexConferenceTest extends TestTemplate {
Assert.assertEquals(1, conferencesPage.getConferencesList().size());
}
@Test
public void testDeleteConf() throws InterruptedException {
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());
Integer size = conferencesPage.getConferencesList().size();
conferencesPage.deleteFirst();
Thread.sleep(2000);
conferencesPage.clickConfirm();
Assert.assertEquals(size - 1, conferencesPage.getConferencesList().size());
}
}

View File

@ -29,4 +29,12 @@ public class ConferencesPage extends PageObject {
driver.findElements(By.className("bootstrap-select")).get(1).findElement(By.className("btn")).click();
driver.findElements(By.className("bootstrap-select")).get(1).findElements(By.className("dropdown-item")).get(1).click();
}
public void deleteFirst() {
driver.findElement(By.xpath("//*[@id=\"conferences\"]/div/div[2]/div[1]/div[1]/div/input[2]")).submit();
}
public void clickConfirm() {
driver.findElement(By.xpath("//*[@id=\"deleteConference\"]")).click();
}
}