#103 add paper transition

This commit is contained in:
Nightblade73 2019-05-10 20:54:43 +04:00
parent cad8682088
commit 4e4e7ae194
2 changed files with 26 additions and 4 deletions

View File

@ -162,6 +162,10 @@ body {
white-space: nowrap; white-space: nowrap;
} }
.dropdown-menu {
max-width: 445px;
}
.icon { .icon {

View File

@ -191,7 +191,7 @@ public class IndexConferenceTest extends TestTemplate {
conferencePage.clickAddPaperBut(); conferencePage.clickAddPaperBut();
List<WebElement> webElements = conferencePage.getPapers(); List<WebElement> webElements = conferencePage.getPapers();
String paperName = webElements.get(webElements.size() - 1).findElement(By.tagName("a")).findElements(By.tagName("span")).get(1).getText(); 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));
@ -200,8 +200,26 @@ public class IndexConferenceTest extends TestTemplate {
&& conferencePage.getPapers() && conferencePage.getPapers()
.stream() .stream()
.anyMatch(webElement -> webElement .anyMatch(webElement -> webElement
.findElement(By.tagName("a")) .findElements(By.tagName("input"))
.findElements(By.tagName("span")) .get(1).getAttribute("value")
.get(1).getText().equals(paperName))); .equals(paperName)));
}
@Test
public void testTransitionToTheArticle() {
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();
WebElement paper = conferencePage.getPapers().get(0);
String paperName = paper.findElements(By.tagName("input")).get(1).getAttribute("value");
paper.findElement(By.tagName("a")).click();
Assertions.assertThat(conferencePage.getName())
.isEqualTo(paperName);
} }
} }