Resolve "Генерация периодических задач по тегам" #207

Merged
ashette merged 32 commits from 79-students-tags-generation into dev 2019-05-16 07:30:47 +04:00
Showing only changes of commit 4686406954 - Show all commits

View File

@ -159,17 +159,17 @@ public class IndexConferenceTest extends TestTemplate {
conferencesPage.getConferenceFirst(); conferencesPage.getConferenceFirst();
String conferenceId = conferencePage.getId(); String conferenceId = conferencePage.getId();
Integer paperCount = conferencePage.getPaperCount(); Integer paperCount = conferencePage.getArticlesCount();
conferencePage.showAllowToAttachArticles(); conferencePage.showAllowToAttachArticles();
WebElement paper = conferencePage.selectPaper(); WebElement paper = conferencePage.selectArticle();
String paperName = paper.findElement(By.className("text")).getText(); String paperName = paper.findElement(By.className("text")).getText();
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(paperCount + 1 == conferencePage.getPaperCount() Assert.assertTrue(paperCount + 1 == conferencePage.getArticlesCount()
&& conferencePage.getPapers() && conferencePage.getArticles()
.stream() .stream()
.anyMatch(webElement -> webElement .anyMatch(webElement -> webElement
.findElement(By.className("paper-name")) .findElement(By.className("paper-name"))
@ -187,17 +187,17 @@ public class IndexConferenceTest extends TestTemplate {
conferencesPage.getConferenceFirst(); conferencesPage.getConferenceFirst();
String conferenceId = conferencePage.getId(); String conferenceId = conferencePage.getId();
Integer paperCount = conferencePage.getPaperCount(); Integer paperCount = conferencePage.getArticlesCount();
conferencePage.clickAddPaperBut(); conferencePage.clickAddPaperBut();
List<WebElement> webElements = conferencePage.getPapers(); List<WebElement> webElements = conferencePage.getArticles();
String paperName = webElements.get(webElements.size() - 1).findElements(By.tagName("input")).get(1).getAttribute("value"); String paperName = webElements.get(webElements.size() - 1).findElements(By.tagName("input")).get(1).getAttribute("value");
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(paperCount + 1 == conferencePage.getPaperCount() Assert.assertTrue(paperCount + 1 == conferencePage.getArticlesCount()
&& conferencePage.getPapers() && conferencePage.getArticles()
.stream() .stream()
.anyMatch(webElement -> webElement .anyMatch(webElement -> webElement
.findElements(By.tagName("input")) .findElements(By.tagName("input"))
@ -215,11 +215,31 @@ public class IndexConferenceTest extends TestTemplate {
conferencesPage.getConferenceFirst(); conferencesPage.getConferenceFirst();
WebElement paper = conferencePage.getPapers().get(0); WebElement paper = conferencePage.getArticles().get(0);
String paperName = paper.findElements(By.tagName("input")).get(1).getAttribute("value"); String paperName = paper.findElements(By.tagName("input")).get(1).getAttribute("value");
paper.findElement(By.tagName("a")).click(); paper.findElement(By.tagName("a")).click();
Assertions.assertThat(conferencePage.getName()) Assertions.assertThat(conferencePage.getName())
.isEqualTo(paperName); .isEqualTo(paperName);
} }
@Test
public void testUndockArticle() {
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.getArticlesCount();
conferencePage.clickUndockArticleBut();
conferencePage.clickSaveBut();
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
Assert.assertTrue(paperCount - 1 == conferencePage.getArticlesCount());
}
} }