|
|
@ -5,10 +5,11 @@ import conference.ConferencesDashboardPage;
|
|
|
|
import conference.ConferencesPage;
|
|
|
|
import conference.ConferencesPage;
|
|
|
|
import core.PageObject;
|
|
|
|
import core.PageObject;
|
|
|
|
import core.TestTemplate;
|
|
|
|
import core.TestTemplate;
|
|
|
|
import org.assertj.core.api.Assertions;
|
|
|
|
|
|
|
|
import org.junit.Assert;
|
|
|
|
import org.junit.Assert;
|
|
|
|
|
|
|
|
import org.junit.FixMethodOrder;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
|
|
|
import org.junit.runners.MethodSorters;
|
|
|
|
import org.openqa.selenium.By;
|
|
|
|
import org.openqa.selenium.By;
|
|
|
|
import org.openqa.selenium.WebElement;
|
|
|
|
import org.openqa.selenium.WebElement;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -23,6 +24,7 @@ import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
|
|
|
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
|
|
|
@SpringBootTest(classes = NgTrackerApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
|
|
|
@SpringBootTest(classes = NgTrackerApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
|
|
|
public class IndexConferenceTest extends TestTemplate {
|
|
|
|
public class IndexConferenceTest extends TestTemplate {
|
|
|
|
private final Map<PageObject, List<String>> navigationHolder = ImmutableMap.of(
|
|
|
|
private final Map<PageObject, List<String>> navigationHolder = ImmutableMap.of(
|
|
|
@ -35,15 +37,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
private ApplicationProperties applicationProperties;
|
|
|
|
private ApplicationProperties applicationProperties;
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testStartApplication() {
|
|
|
|
public void testA_CreateNewConference() {
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl());
|
|
|
|
|
|
|
|
Assertions
|
|
|
|
|
|
|
|
.assertThat(getContext().getTitle())
|
|
|
|
|
|
|
|
.isEqualTo("NG-Tracker");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void testCreateNewConference() {
|
|
|
|
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 1);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 1);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -60,7 +54,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testChangeConferenceNameAndSave() {
|
|
|
|
public void testB_ChangeConferenceNameAndSave() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -79,7 +73,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testAddDeadlineAndSave() {
|
|
|
|
public void testC_AddDeadlineAndSave() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -109,7 +103,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testTakePartAndSave() {
|
|
|
|
public void testD_TakePartAndSave() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -130,7 +124,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testDeleteDeadlineAndSave() {
|
|
|
|
public void testE_DeleteDeadlineAndSave() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -146,11 +140,11 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + String.format("/conferences/conference?id=%s", conferenceId));
|
|
|
|
|
|
|
|
|
|
|
|
Assert.assertTrue(deadlineCount - 1 == conferencePage.getDeadlineCount());
|
|
|
|
Assert.assertEquals(deadlineCount - 1, (int) conferencePage.getDeadlineCount());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testAttachArticle() {
|
|
|
|
public void testF_AttachArticle() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -178,7 +172,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testAddArticle() {
|
|
|
|
public void testG_AddArticle() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -205,26 +199,27 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
.equals(paperName)));
|
|
|
|
.equals(paperName)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
// @Test
|
|
|
|
public void testTransitionToTheArticle() {
|
|
|
|
// @Order(8)
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
// 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());
|
|
|
|
// getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
ConferencePage conferencePage = (ConferencePage) getContext().initPage(Iterables.get(navigationHolder.entrySet(), 1).getKey());
|
|
|
|
// ConferencesPage conferencesPage = (ConferencesPage) getContext().initPage(page.getKey());
|
|
|
|
|
|
|
|
// ConferencePage conferencePage = (ConferencePage) getContext().initPage(Iterables.get(navigationHolder.entrySet(), 1).getKey());
|
|
|
|
conferencesPage.getConferenceFirst();
|
|
|
|
//
|
|
|
|
|
|
|
|
// conferencesPage.getConferenceFirst();
|
|
|
|
WebElement paper = conferencePage.getArticles().get(0);
|
|
|
|
//
|
|
|
|
String paperName = paper.findElements(By.tagName("input")).get(1).getAttribute("value");
|
|
|
|
// WebElement paper = conferencePage.getArticles().get(0);
|
|
|
|
paper.findElement(By.tagName("a")).click();
|
|
|
|
// String paperName = paper.findElements(By.tagName("input")).get(1).getAttribute("value");
|
|
|
|
|
|
|
|
// paper.findElement(By.tagName("a")).click();
|
|
|
|
Assertions.assertThat(conferencePage.getName())
|
|
|
|
//
|
|
|
|
.isEqualTo(paperName);
|
|
|
|
// Assertions.assertThat(conferencePage.getName())
|
|
|
|
}
|
|
|
|
// .isEqualTo(paperName);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testUndockArticle() {
|
|
|
|
public void testH_UndockArticle() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -244,7 +239,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testSortAndFilterConferenceList() {
|
|
|
|
public void testI_SortAndFilterConferenceList() {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -257,7 +252,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testDeleteConf() throws InterruptedException {
|
|
|
|
public void testJ_DeleteConf() throws InterruptedException {
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
Map.Entry<PageObject, List<String>> page = Iterables.get(navigationHolder.entrySet(), 0);
|
|
|
|
|
|
|
|
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
|
getContext().goTo(applicationProperties.getBaseUrl() + page.getValue().get(1));
|
|
|
@ -265,7 +260,7 @@ public class IndexConferenceTest extends TestTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
Integer size = conferencesPage.getConferencesList().size();
|
|
|
|
Integer size = conferencesPage.getConferencesList().size();
|
|
|
|
conferencesPage.deleteFirst();
|
|
|
|
conferencesPage.deleteFirst();
|
|
|
|
Thread.sleep(2000);
|
|
|
|
Thread.sleep(3000);
|
|
|
|
conferencesPage.clickConfirm();
|
|
|
|
conferencesPage.clickConfirm();
|
|
|
|
|
|
|
|
|
|
|
|
Assert.assertEquals(size - 1, conferencesPage.getConferencesList().size());
|
|
|
|
Assert.assertEquals(size - 1, conferencesPage.getConferencesList().size());
|
|
|
|