|
|
@ -176,4 +176,32 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
.findElements(By.tagName("span"))
|
|
|
|
.findElements(By.tagName("span"))
|
|
|
|
.get(1).getText().equals(paperName)));
|
|
|
|
.get(1).getText().equals(paperName)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void testAddArticle() {
|
|
|
|
|
|
|
|
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 paperCount = conferencePage.getPaperCount();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conferencePage.clickAddPaperBut();
|
|
|
|
|
|
|
|
List<WebElement> webElements = conferencePage.getPapers();
|
|
|
|
|
|
|
|
String paperName = webElements.get(webElements.size() - 1).findElement(By.tagName("a")).findElements(By.tagName("span")).get(1).getText();
|
|
|
|
|
|
|
|
conferencePage.clickSaveBut();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.assertTrue(paperCount + 1 == conferencePage.getPaperCount()
|
|
|
|
|
|
|
|
&& conferencePage.getPapers()
|
|
|
|
|
|
|
|
.stream()
|
|
|
|
|
|
|
|
.anyMatch(webElement -> webElement
|
|
|
|
|
|
|
|
.findElement(By.tagName("a"))
|
|
|
|
|
|
|
|
.findElements(By.tagName("span"))
|
|
|
|
|
|
|
|
.get(1).getText().equals(paperName)));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|