#103 add adding article

merge-requests/90/head
Nightblade73 5 years ago
parent d9a4224317
commit cad8682088

@ -140,6 +140,7 @@ body {
.paper-name {
flex: 1;
overflow: hidden;
}
.paper-name:hover {
@ -156,6 +157,11 @@ body {
float: left;
}
.paper-name span:nth-child(2) {
max-width: 326px;
white-space: nowrap;
}
.icon {

@ -176,4 +176,32 @@ public class IndexConferenceTest extends TestTemplate {
.findElements(By.tagName("span"))
.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)));
}
}

@ -85,4 +85,8 @@ public class ConferencePage extends PageObject {
webElement.click();
return webElement;
}
public void clickAddPaperBut() {
driver.findElement(By.id("add-paper")).click();
}
}
Loading…
Cancel
Save