|
|
|
@ -9,6 +9,7 @@ import org.assertj.core.api.Assertions;
|
|
|
|
|
import org.junit.Assert;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
import org.openqa.selenium.By;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
@ -76,5 +77,33 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
|
.anyMatch(webElement -> webElement.getText().equals(newConferenceName)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testAddDeadlineAndSave() {
|
|
|
|
|
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 deadlineCount = conferencePage.getDeadlineCount();
|
|
|
|
|
|
|
|
|
|
String description = "test";
|
|
|
|
|
String date = "09.09.2019";
|
|
|
|
|
String dateValue = "2019-09-09";
|
|
|
|
|
conferencePage.clickAddDeadlineBut();
|
|
|
|
|
conferencePage.setDeadlineDescription(description, deadlineCount);
|
|
|
|
|
conferencePage.setDeadlineDate(date, deadlineCount);
|
|
|
|
|
conferencePage.clickSaveBut();
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
|
|
|
|
|
|
Assert.assertTrue(conferencePage.getDeadlineList()
|
|
|
|
|
.stream()
|
|
|
|
|
.anyMatch(webElement -> {
|
|
|
|
|
return webElement.findElement(By.className("deadline-text")).getAttribute("value").equals(description)
|
|
|
|
|
&& webElement.findElement(By.cssSelector("input[type=\"date\"]")).getAttribute("value").equals(dateValue);
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|