|
|
@ -10,6 +10,7 @@ import org.junit.Assert;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.openqa.selenium.By;
|
|
|
|
import org.openqa.selenium.By;
|
|
|
|
|
|
|
|
import org.openqa.selenium.WebElement;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
@ -117,14 +118,14 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
conferencesPage.getConferenceFirst();
|
|
|
|
conferencesPage.getConferenceFirst();
|
|
|
|
String conferenceId = conferencePage.getId();
|
|
|
|
String conferenceId = conferencePage.getId();
|
|
|
|
Integer membersCount = conferencePage.getMemperCount();
|
|
|
|
Integer membersCount = conferencePage.getMemberCount();
|
|
|
|
|
|
|
|
|
|
|
|
conferencePage.clickTakePartBut();
|
|
|
|
conferencePage.clickTakePartBut();
|
|
|
|
conferencePage.clickSaveBut();
|
|
|
|
conferencePage.clickSaveBut();
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
|
|
|
|
|
|
|
|
Assert.assertTrue(membersCount + 1 == conferencePage.getMemperCount()
|
|
|
|
Assert.assertTrue(membersCount + 1 == conferencePage.getMemberCount()
|
|
|
|
&& conferencePage.getTakePartButDisabledValue().equals("true"));
|
|
|
|
&& conferencePage.getTakePartButDisabledValue().equals("true"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -147,4 +148,32 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
Assert.assertTrue(deadlineCount - 1 == conferencePage.getDeadlineCount());
|
|
|
|
Assert.assertTrue(deadlineCount - 1 == conferencePage.getDeadlineCount());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void testAttachArticle() {
|
|
|
|
|
|
|
|
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.showAllowToAttachArticles();
|
|
|
|
|
|
|
|
WebElement paper = conferencePage.selectPaper();
|
|
|
|
|
|
|
|
String paperName = paper.findElement(By.className("text")).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.className("paper-name"))
|
|
|
|
|
|
|
|
.findElements(By.tagName("span"))
|
|
|
|
|
|
|
|
.get(1).getText().equals(paperName)));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|