From 4e4e7ae1948ac8ccfe1c4c612358c6399f887b30 Mon Sep 17 00:00:00 2001 From: Nightblade73 Date: Fri, 10 May 2019 20:54:43 +0400 Subject: [PATCH] #103 add paper transition --- src/main/resources/public/css/conference.css | 4 +++ src/test/java/IndexConferenceTest.java | 26 +++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/main/resources/public/css/conference.css b/src/main/resources/public/css/conference.css index 26ac40e..dc83057 100644 --- a/src/main/resources/public/css/conference.css +++ b/src/main/resources/public/css/conference.css @@ -162,6 +162,10 @@ body { white-space: nowrap; } +.dropdown-menu { + max-width: 445px; +} + .icon { diff --git a/src/test/java/IndexConferenceTest.java b/src/test/java/IndexConferenceTest.java index a2e0124..b3314ff 100644 --- a/src/test/java/IndexConferenceTest.java +++ b/src/test/java/IndexConferenceTest.java @@ -191,7 +191,7 @@ public class IndexConferenceTest extends TestTemplate { conferencePage.clickAddPaperBut(); List 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(); getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId)); @@ -200,8 +200,26 @@ public class IndexConferenceTest extends TestTemplate { && conferencePage.getPapers() .stream() .anyMatch(webElement -> webElement - .findElement(By.tagName("a")) - .findElements(By.tagName("span")) - .get(1).getText().equals(paperName))); + .findElements(By.tagName("input")) + .get(1).getAttribute("value") + .equals(paperName))); + } + + @Test + public void testTransitionToTheArticle() { + Map.Entry> 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); } }