Skip to content

Commit

Permalink
Fix ProcessesSelectingST
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Sep 5, 2023
1 parent 043ea62 commit 827a1f5
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions Kitodo/src/test/java/org/kitodo/selenium/ProcessesSelectingST.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,11 @@ public class ProcessesSelectingST extends BaseTestSelenium {
public static void setup() throws Exception {

User user = ServiceManager.getUserService().getById(1);
user.setTableSize(2);
user.setTableSize(1);
ServiceManager.getUserService().saveToDatabase(user);
addProcesses();
processesPage = Pages.getProcessesPage();
}

private static void addProcesses() throws Exception {
Project projectOne = ServiceManager.getProjectService().getById(1);
Template template = ServiceManager.getTemplateService().getById(1);

Process forthProcess = new Process();
forthProcess.setTitle("Forth process");
LocalDate localDate = LocalDate.of(2020, 3, 20);
forthProcess.setCreationDate(Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
forthProcess.setWikiField("SelectionTest");
forthProcess.setDocket(ServiceManager.getDocketService().getById(1));
forthProcess.setProject(projectOne);
forthProcess.setRuleset(ServiceManager.getRulesetService().getById(1));
forthProcess.setTemplate(template);
ServiceManager.getProcessService().save(forthProcess);

Process fifthProcess = new Process();
fifthProcess.setTitle("Fifth process");
localDate = LocalDate.of(2020, 4, 20);
fifthProcess.setCreationDate(Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
fifthProcess.setWikiField("SelectionTest");
fifthProcess.setDocket(ServiceManager.getDocketService().getById(1));
fifthProcess.setProject(projectOne);
fifthProcess.setRuleset(ServiceManager.getRulesetService().getById(1));
fifthProcess.setTemplate(template);
ServiceManager.getProcessService().save(fifthProcess);
}

@Before
public void login() throws Exception {
Pages.getLoginPage().goTo().performLoginAsAdmin();
Expand All @@ -94,7 +66,7 @@ public void selectAllProcessesOnPageTest() throws Exception {
processesPage.goTo();

processesPage.selectAllRowsOnPage();
assertEquals(processesPage.countListedSelectedProcesses(), 2);
assertEquals(processesPage.countListedSelectedProcesses(), 1);

processesPage.goToNextPage();
assertEquals(processesPage.countListedSelectedProcesses(), 0);
Expand All @@ -109,9 +81,9 @@ public void selectAllProcessesTest() throws Exception {
processesPage.goTo();

processesPage.selectAllRows();
assertEquals(processesPage.countListedSelectedProcesses(), 2);
assertEquals(processesPage.countListedSelectedProcesses(), 1);

processesPage.goToNextPage();
assertEquals(processesPage.countListedSelectedProcesses(), 2);
assertEquals(processesPage.countListedSelectedProcesses(), 1);
}
}

0 comments on commit 827a1f5

Please sign in to comment.