diff --git a/playwright/process-test-project/dataclasses/market/Person.d.json b/playwright/process-test-project/dataclasses/market/Person.d.json new file mode 100644 index 000000000..5c84bdae3 --- /dev/null +++ b/playwright/process-test-project/dataclasses/market/Person.d.json @@ -0,0 +1,23 @@ +{ + "$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json", + "simpleName" : "Person", + "namespace" : "market", + "isBusinessCaseData" : false, + "fields" : [ { + "name" : "id", + "type" : "Long", + "modifiers" : [ "PERSISTENT" ] + }, { + "name" : "firstname", + "type" : "String", + "modifiers" : [ "PERSISTENT" ] + }, { + "name" : "lastname", + "type" : "String", + "modifiers" : [ "PERSISTENT" ] + }, { + "name" : "title", + "type" : "String", + "modifiers" : [ "PERSISTENT" ] + } ] +} \ No newline at end of file diff --git a/playwright/process-test-project/dataclasses/market/UserScriptData.d.json b/playwright/process-test-project/dataclasses/market/UserScriptData.d.json new file mode 100644 index 000000000..6143d6350 --- /dev/null +++ b/playwright/process-test-project/dataclasses/market/UserScriptData.d.json @@ -0,0 +1,11 @@ +{ + "$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json", + "simpleName" : "UserScriptData", + "namespace" : "market", + "isBusinessCaseData" : false, + "fields" : [ { + "name" : "user", + "type" : "market.Person", + "modifiers" : [ "PERSISTENT" ] + } ] +} \ No newline at end of file diff --git a/playwright/process-test-project/dataclasses/market/erpData.d.json b/playwright/process-test-project/dataclasses/market/erpData.d.json new file mode 100644 index 000000000..6a5d4a222 --- /dev/null +++ b/playwright/process-test-project/dataclasses/market/erpData.d.json @@ -0,0 +1,11 @@ +{ + "$schema" : "https://json-schema.axonivy.com/data-class/12.0.0/data-class.json", + "simpleName" : "erpData", + "namespace" : "market", + "isBusinessCaseData" : false, + "fields" : [ { + "name" : "user", + "type" : "market.Person", + "modifiers" : [ "PERSISTENT" ] + } ] +} \ No newline at end of file diff --git a/playwright/process-test-project/processes/market/UserEnroll.p.json b/playwright/process-test-project/processes/market/UserEnroll.p.json new file mode 100644 index 000000000..9094f6d18 --- /dev/null +++ b/playwright/process-test-project/processes/market/UserEnroll.p.json @@ -0,0 +1,52 @@ +{ + "$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json", + "id" : "193E3ABB2D641C01", + "config" : { + "data" : "market.UserScriptData" + }, + "elements" : [ { + "id" : "f0", + "type" : "RequestStart", + "name" : "enroll", + "config" : { + "signature" : "start" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : [ + { "id" : "f2", "to" : "f5" } + ] + }, { + "id" : "f1", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 }, + "labelOffset" : { "x" : 13, "y" : 33 } + } + }, { + "id" : "f5", + "type" : "SubProcessCall", + "name" : "evalUser", + "config" : { + "processCall" : "market/erp:evalUser(Long)", + "call" : { + "map" : { + "param.id" : "in.user.id" + } + }, + "output" : { + "map" : { + "out" : "in", + "out.user" : "result.user" + } + } + }, + "visual" : { + "at" : { "x" : 224, "y" : 64 } + }, + "connect" : [ + { "id" : "f3", "to" : "f1" } + ] + } ] +} \ No newline at end of file diff --git a/playwright/process-test-project/processes/market/UserScript.p.json b/playwright/process-test-project/processes/market/UserScript.p.json new file mode 100644 index 000000000..ad7cb04ea --- /dev/null +++ b/playwright/process-test-project/processes/market/UserScript.p.json @@ -0,0 +1,58 @@ +{ + "$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json", + "id" : "193E3B0AD20672E7", + "config" : { + "data" : "market.UserScriptData" + }, + "elements" : [ { + "id" : "f0", + "type" : "RequestStart", + "name" : "enroll", + "config" : { + "signature" : "start" + }, + "visual" : { + "at" : { "x" : 96, "y" : 64 } + }, + "connect" : [ + { "id" : "f2", "to" : "f3" } + ] + }, { + "id" : "f1", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 392, "y" : 64 }, + "labelOffset" : { "x" : 13, "y" : 33 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "lookupErp", + "config" : { + "output" : { + "code" : "// my heavy java lookup" + } + }, + "visual" : { + "at" : { "x" : 240, "y" : 63 }, + "size" : { "width" : 120, "height" : 63 } + }, + "connect" : [ + { "id" : "f4", "to" : "f1", "color" : "default" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : [ + "Heavy Java Logic:", + "- Connects to ERP", + "- Finds users by ID" + ], + "visual" : { + "at" : { "x" : 240, "y" : 160 } + }, + "connect" : [ + { "id" : "f6", "to" : "f3" } + ] + } ] +} \ No newline at end of file diff --git a/playwright/process-test-project/processes/market/erp.p.json b/playwright/process-test-project/processes/market/erp.p.json new file mode 100644 index 000000000..c2da99666 --- /dev/null +++ b/playwright/process-test-project/processes/market/erp.p.json @@ -0,0 +1,79 @@ +{ + "$schema" : "https://json-schema.axonivy.com/process/12.0.0/process.json", + "id" : "193E3AEFF2379C85", + "kind" : "CALLABLE_SUB", + "config" : { + "data" : "market.erpData" + }, + "elements" : [ { + "id" : "f0", + "type" : "CallSubStart", + "name" : "evalUser(Long)", + "config" : { + "signature" : "evalUser", + "input" : { + "params" : [ + { "name" : "id", "type" : "Long", "desc" : "known unique ERP userID" } + ], + "map" : { + "out.user.id" : "param.id" + } + }, + "result" : { + "params" : [ + { "name" : "user", "type" : "market.Person", "desc" : "Resolved ERP user" } + ], + "map" : { + "result.user" : "in.user" + } + } + }, + "tags" : [ + "connector" + ], + "visual" : { + "at" : { "x" : 96, "y" : 64 }, + "icon" : "res:/webContent/icons/Developer.jpg?small" + }, + "connect" : [ + { "id" : "f2", "to" : "f3" } + ] + }, { + "id" : "f1", + "type" : "CallSubEnd", + "visual" : { + "at" : { "x" : 352, "y" : 64 }, + "labelOffset" : { "x" : 13, "y" : 33 } + } + }, { + "id" : "f3", + "type" : "Script", + "name" : "lookupErp", + "config" : { + "output" : { + "code" : "// my heavy java lookup" + } + }, + "visual" : { + "at" : { "x" : 224, "y" : 63 }, + "size" : { "width" : 120, "height" : 63 } + }, + "connect" : [ + { "id" : "f4", "to" : "f1" } + ] + }, { + "id" : "f5", + "type" : "ProcessAnnotation", + "name" : [ + "Heavy Java Logic:", + "- Connects to ERP", + "- Finds users by ID" + ], + "visual" : { + "at" : { "x" : 224, "y" : 160 } + }, + "connect" : [ + { "id" : "f6", "to" : "f3" } + ] + } ] +} \ No newline at end of file diff --git a/playwright/tests/screenshots/editor/editor.spec.ts b/playwright/tests/screenshots/editor/editor.spec.ts index cf62397e2..f3b9760d9 100644 --- a/playwright/tests/screenshots/editor/editor.spec.ts +++ b/playwright/tests/screenshots/editor/editor.spec.ts @@ -1,6 +1,7 @@ import type { Page } from '@playwright/test'; import { test, expect } from '@playwright/test'; import { ProcessEditor } from '../../page-objects/editor/process-editor'; +import { Inscription } from '../../page-objects/inscription/inscription-view'; test.beforeEach(async ({ page }) => { await page.emulateMedia({ colorScheme: 'light' }); @@ -40,6 +41,18 @@ test('extensions', async ({ page }) => { await screenshot(page, 'extensions.png'); }); +test('connector-process', async ({ page }) => { + const editor = await ProcessEditor.openProcess(page, { file: '/processes/market/erp.p.json', waitFor: '.sprotty-graph' }); + await editor.element('start:callSubStart').inscribe(); + const inscription = new Inscription(page); + inscription.waitForView(); + const start = inscription.accordion('Start'); + await start.toggle(); + await start.section('Mapping').close(); + await start.section('Input parameters').open(); + await screenshot(page, 'connector-process.png'); +}); + async function screenshot(page: Page, name: string, size?: { width?: number; height?: number }) { await page.setViewportSize({ width: size?.width ?? 700, height: size?.height ?? 550 }); const dir = process.env.SCREENSHOT_DIR ?? './target';