Skip to content

Commit

Permalink
Merge branch 'master' into
Browse files Browse the repository at this point in the history
feature/IVYPORTAL-17542-Use-latest-web-tester-to-run-all-tests
  • Loading branch information
tphvu-axonivy committed Nov 25, 2024
2 parents bd60c42 + 87dbbc4 commit 11a7043
Show file tree
Hide file tree
Showing 1,376 changed files with 13,115 additions and 9,653 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=portalKit_test.Data
ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=portalKit_test
ch.ivyteam.ivy.designer.preferences.editor.ProcessEditorPreferencePage\:ELEMENT_STYLE=BPMN
ch.ivyteam.ivy.designer.preferences.editor.ProcessEditorPreferencePage\:NET_BACKGROUND_COLOR=255,255,255
Expand All @@ -7,5 +6,5 @@ ch.ivyteam.ivy.designer.preferences.editor.ProcessEditorPreferencePage\:SHOW_GRI
ch.ivyteam.ivy.designer.preferences.editor.ProcessEditorPreferencePage\:useProjectSettings=true
ch.ivyteam.ivy.project.preferences\:PORTAL_VERSION=10
ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=13
ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=114006
ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=120001
eclipse.preferences.version=1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "TaskGenerationData",
"namespace" : "ch.ivy.add.portalkit.task",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "TaskGenerationDataRange",
"namespace" : "ch.ivy.add.portalkit.task",
"isBusinessCaseData" : false,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "Data",
"namespace" : "internaltest",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "AdminSettingsData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "DashboardCreationData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "Data",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
"fields" : [ {
"name" : "iTask",
"type" : "ch.ivyteam.ivy.workflow.ITask",
"modifiers" : [ "PERSISTENT" ]
}, {
"name" : "taskId",
"type" : "Number",
"modifiers" : [ "PERSISTENT" ]
Expand All @@ -33,15 +29,13 @@
"modifiers" : [ "PERSISTENT" ]
}, {
"name" : "cases",
"type" : "List<ch.ivyteam.ivy.workflow.ICase>",
"modifiers" : [ "PERSISTENT" ]
"type" : "List<ch.ivyteam.ivy.workflow.ICase>"
}, {
"name" : "count",
"type" : "Integer",
"modifiers" : [ "PERSISTENT" ]
}, {
"name" : "workingCase",
"type" : "ch.ivyteam.ivy.workflow.ICase",
"modifiers" : [ "PERSISTENT" ]
"type" : "ch.ivyteam.ivy.workflow.ICase"
} ]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "DataCreationData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "GrantPermissionsData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "LoginData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "PortalGlobalVariableHelperData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "PortalSettingHelperData",
"namespace" : "portalKit_test",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "14B2A3DC7173EA26",
"config" : {
"data" : "ch.ivy.add.portalkit.task.TaskGenerationDataRange"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "1511A66AF619A768",
"config" : {
"data" : "portalKit_test.Data"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "18B031C59C3C7814",
"config" : {
"data" : "portalKit_test.Data"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "17F2050944B46BB0",
"config" : {
"data" : "portalKit_test.DashboardCreationData"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "153CACC26D0D4C3D",
"config" : {
"data" : "portalKit_test.DataCreationData"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "14DE09882B540AD5",
"config" : {
"data" : "portalKit_test.GrantPermissionsData"
Expand Down Expand Up @@ -2088,7 +2088,7 @@
"type" : "RequestStart",
"name" : "denyTaskDetailsShareLinkPermission.ivp",
"config" : {
"signature" : "denyTaskDetailsShareLinkPermission2",
"signature" : "denyTaskDetailsShareLinkPermission",
"request" : {
"name" : "Deny Share Link Task Details Permision"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "1636734E13CEC872",
"config" : {
"data" : "portalKit_test.LoginData"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "176463FD4BBF6C93",
"config" : {
"data" : "portalKit_test.Data"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "18D596926C35B1DB",
"config" : {
"data" : "portalKit_test.Data"
Expand All @@ -9,7 +9,12 @@
"type" : "RequestStart",
"name" : "testPortalCustomErrorHandler.ivp",
"config" : {
"signature" : "testPortalCustomErrorHandler"
"signature" : "testPortalCustomErrorHandler",
"task" : {
"customFields" : [
{ "name" : "embedInFrame", "type" : "STRING", "value" : "\"false\"" }
]
}
},
"visual" : {
"at" : { "x" : 96, "y" : 64 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "1749B87B8C1B77BE",
"config" : {
"data" : "portalKit_test.PortalGlobalVariableHelperData"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "17208192E0AF4185",
"config" : {
"data" : "portalKit_test.PortalSettingHelperData"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "169BDE2F368D6EC4",
"config" : {
"data" : "portalKit_test.Data"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,105 +1,54 @@
package ch.ivy.addon.portalkit.test.util;

import java.util.ArrayList;
import java.util.List;

import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.persistence.IQueryResult;
import ch.ivyteam.ivy.security.exec.Sudo;
import ch.ivyteam.ivy.workflow.CaseProperty;
import ch.ivyteam.ivy.workflow.CaseState;
import ch.ivyteam.ivy.workflow.ICase;
import ch.ivyteam.ivy.workflow.IPropertyFilter;
import ch.ivyteam.ivy.workflow.ITask;
import ch.ivyteam.ivy.workflow.TaskProperty;
import ch.ivyteam.ivy.workflow.TaskState;
import ch.ivyteam.ivy.workflow.query.CaseQuery;
import ch.ivyteam.ivy.workflow.query.TaskQuery;

public class TaskUtils {

public static List<ICase> destroyAllCase() {
try {
return Sudo.call(() -> {
try {
IPropertyFilter<CaseProperty> noFilter = null;
IQueryResult<ICase> qr = Ivy.wf().findCases(noFilter, null, 0, -1, true);
List<ICase> names = new ArrayList<ICase>();
for (ICase ivyCase : qr.getResultList()) {
try {
if (ivyCase.getState().intValue() != TaskState.DESTROYED.intValue()
&& ivyCase.getState().intValue() != TaskState.DONE.intValue()) {
ivyCase.destroy();
}
} catch (Exception e1) {
Ivy.log().error(e1);
}
}
return names;
} catch (Exception e2) {
Ivy.log().error(e2);
return null;
}
});
} catch (Exception e) {
Ivy.log().error(e);
public static void destroyAllCase() throws Exception {
Sudo.call(() -> {
List<ICase> result = Ivy.wf().getCaseQueryExecutor()
.getResults(CaseQuery.create().where().state().isNotIn(CaseState.DESTROYED, CaseState.DONE));
for (ICase iCaze : result) {
iCaze.destroy();
}
return null;
}
}

public static boolean resumeFirstTask() {
try {
Sudo.call(() -> {
try {
IPropertyFilter<TaskProperty> filter = null;
IQueryResult<ITask> result = Ivy.wf().findTasks(filter, null, 0, -1, true);
List<ITask> tasks = result.getResultList();
for (ITask task : tasks) {
if (TaskState.SUSPENDED == task.getState()) {
Ivy.session().resumeTask(task.getId());
break;
}
}
return true;
} catch (Exception e) {
return false;
}
});
} catch (Exception e) {
return false;
}
return false;
});
}

public static void deleteCompletedCases() throws Exception {
Sudo.call(() -> {
IPropertyFilter<CaseProperty> noFilter = null;
IQueryResult<ICase> qr = Ivy.wf().findCases(noFilter, null, 0, -1, true);
for (ICase ivyCase : qr.getResultList()) {
if (ivyCase.getState() == CaseState.DESTROYED || ivyCase.getState() == CaseState.DONE) {
Ivy.wf().deleteCompletedCase(ivyCase);
}
List<ICase> result = Ivy.wf().getCaseQueryExecutor()
.getResults(CaseQuery.create().where().state().isIn(CaseState.DESTROYED, CaseState.DONE));
for (ICase iCaze : result) {
Ivy.wf().deleteCompletedCase(iCaze);
}
return null;
});
}

public static void deleteDestroyedCases() throws Exception {
Sudo.call(() -> {
IPropertyFilter<CaseProperty> noFilter = null;
IQueryResult<ICase> qr = Ivy.wf().findCases(noFilter, null, 0, -1, true);
for (ICase ivyCase : qr.getResultList()) {
if (ivyCase.getState() == CaseState.DESTROYED) {
Ivy.wf().deleteCompletedCase(ivyCase);
}
List<ICase> result = Ivy.wf().getCaseQueryExecutor()
.getResults(CaseQuery.create().where().state().isEqual(CaseState.DESTROYED));
for (ICase iCaze : result) {
Ivy.wf().deleteCompletedCase(iCaze);
}
return null;
});
}

public static void destroyTaskByCustomField(String customFieldName) throws Exception {
Sudo.call(() -> {
ITask selectedTask = TaskQuery.create().where().customField()
.stringField(customFieldName).isNotNull().executor().firstResult();
ITask selectedTask =
TaskQuery.create().where().customField().stringField(customFieldName).isNotNull().executor().firstResult();
if (selectedTask != null) {
selectedTask.destroy();
selectedTask.customFields().stringField(customFieldName).delete();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "DestroyTaskPageData",
"namespace" : "ch.ivy.addon.portalkit.showroom.multiapp.tasks.DestroyTaskPage",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "1559AE0A76284C44",
"kind" : "HTML_DIALOG",
"config" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/data-class/11.4.0/data-class.json",
"$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json",
"simpleName" : "ConfirmationData",
"namespace" : "ch.ivy.addon.portalkit.test.Confirmation",
"isBusinessCaseData" : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema" : "https://json-schema.axonivy.com/process/11.3.0/process.json",
"$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json",
"id" : "14B7775CB7A22AF4",
"kind" : "HTML_DIALOG",
"config" : {
Expand Down
Loading

0 comments on commit 11a7043

Please sign in to comment.