From e8123c58779bac1b6e9140091a1581d87a0483b5 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Thu, 9 Jul 2026 14:10:32 +0530 Subject: [PATCH 1/5] adding more e2e test Signed-off-by: kumaradityaraj --- .../tests-e2e/conditional-task.spec.ts | 35 +++++++++++++++ .../tests-e2e/for-loop.spec.ts | 43 +++++++++++++++++++ .../tests-e2e/forever-foreach.spec.ts | 32 ++++++++++++++ .../tests-e2e/validation-error.spec.ts | 29 +++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts create mode 100644 packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts create mode 100644 packages/serverless-workflow-diagram-editor/tests-e2e/forever-foreach.spec.ts create mode 100644 packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts new file mode 100644 index 00000000..47576b60 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { test, expect } from "@playwright/test"; + +test("diagram editor renders conditional task", async ({ page }) => { + await page.goto("/iframe.html?id=examples-workflows--conditional-task"); + + await expect(page.getByTestId("react-flow-canvas")).toBeVisible(); + + await expect(page.getByTestId("start-node-root-entry-node")).toBeVisible(); + + await expect(page.getByTestId("end-node-root-exit-node")).toBeVisible(); + + await expect(page.getByText("raiseErrorIfUnderage")).toBeVisible(); + + await expect(page.locator(".edge-label")).toContainText(".customer.age < 18"); + + await expect(page.getByText("raiseErrorIfUnderage")).toBeVisible(); + + await expect(page.getByText("RAISE", { exact: true })).toBeVisible(); +}); diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts new file mode 100644 index 00000000..2ed9283e --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts @@ -0,0 +1,43 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { test, expect } from "@playwright/test"; + +test("diagram editor renders conditional task", async ({ page }) => { + await page.goto("/iframe.html?id=examples-workflows--for"); + + const forNode = page.getByTestId("for-node-/do/0/checkup"); + + await expect(forNode).toBeVisible(); + + await expect(forNode).toContainText("checkup"); + + await expect(forNode).toContainText("FOR"); + + await expect(page.getByTestId("for-node-/do/0/checkup-badge")).toHaveText("while"); + + const listenNode = page.getByTestId("listen-node-/do/0/checkup/for/do/0/waitForCheckup"); + + await expect(listenNode).toBeVisible(); + + await expect(listenNode).toContainText("waitForCheckup"); + + await expect(listenNode).toContainText("LISTEN"); + + await expect( + page.getByTestId("listen-node-/do/0/checkup/for/do/0/waitForCheckup-badge"), + ).toHaveText("one"); +}); diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/forever-foreach.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/forever-foreach.spec.ts new file mode 100644 index 00000000..401c134e --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/forever-foreach.spec.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { test, expect } from "@playwright/test"; + +test("renders listen node with validation error", async ({ page }) => { + await page.goto("/iframe.html?id=examples-workflows--listen-to-any-forever-foreach"); + + const node = page.getByTestId("listen-node-/do/0/listenToGossips"); + + await expect(node).toContainText("listenToGossips"); + await expect(node).toContainText("LISTEN"); + + await expect(page.getByTestId("listen-node-/do/0/listenToGossips-badge")).toHaveText("any"); + + await expect(page.getByTestId("listen-node-/do/0/listenToGossips-error")).toBeVisible(); + + await expect(node).toHaveClass(/has-error/); +}); diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts new file mode 100644 index 00000000..06deac4b --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { test, expect } from "@playwright/test"; + +test("renders listen node with document validation error", async ({ page }) => { + await page.goto("/iframe.html?id=features-validation-errors--document-error"); + + const errors = page.getByTestId("sidebar-errors"); + await expect(errors).toBeVisible(); + await expect( + errors.getByText( + "The DSL version of the workflow '9.9.8' does not satisfy the DSL version range supported by this SDK '>=1.0.0 <=1.0.3'.", + ), + ).toBeVisible(); +}); From 5457aaa212a7ecbfa009934f9a8c61df3ac4492e Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Thu, 9 Jul 2026 14:13:34 +0530 Subject: [PATCH 2/5] pnpm changeset Signed-off-by: kumaradityaraj --- .changeset/e2e-tests.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/e2e-tests.md diff --git a/.changeset/e2e-tests.md b/.changeset/e2e-tests.md new file mode 100644 index 00000000..5299459e --- /dev/null +++ b/.changeset/e2e-tests.md @@ -0,0 +1,5 @@ +--- +"@serverlessworkflow/diagram-editor": minor +--- + +Adding more e2e tests From b74fb31a0d8cd869406510d900f00286e097114a Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Thu, 9 Jul 2026 17:18:50 +0530 Subject: [PATCH 3/5] copilot suggestions Signed-off-by: kumaradityaraj --- .changeset/e2e-tests.md | 2 +- .../tests-e2e/for-loop.spec.ts | 2 +- .../tests-e2e/validation-error.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.changeset/e2e-tests.md b/.changeset/e2e-tests.md index 5299459e..7757f6e3 100644 --- a/.changeset/e2e-tests.md +++ b/.changeset/e2e-tests.md @@ -2,4 +2,4 @@ "@serverlessworkflow/diagram-editor": minor --- -Adding more e2e tests +Test: expand Playwright E2E coverage for diagram rendering and validation errors diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts index 2ed9283e..12165c07 100644 --- a/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/for-loop.spec.ts @@ -16,7 +16,7 @@ import { test, expect } from "@playwright/test"; -test("diagram editor renders conditional task", async ({ page }) => { +test("diagram editor renders for loop workflow", async ({ page }) => { await page.goto("/iframe.html?id=examples-workflows--for"); const forNode = page.getByTestId("for-node-/do/0/checkup"); diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts index 06deac4b..5046192e 100644 --- a/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts @@ -16,14 +16,14 @@ import { test, expect } from "@playwright/test"; -test("renders listen node with document validation error", async ({ page }) => { +test("renders document validation error in sidebar", async ({ page }) => { await page.goto("/iframe.html?id=features-validation-errors--document-error"); const errors = page.getByTestId("sidebar-errors"); await expect(errors).toBeVisible(); await expect( errors.getByText( - "The DSL version of the workflow '9.9.8' does not satisfy the DSL version range supported by this SDK '>=1.0.0 <=1.0.3'.", + /The DSL version of the workflow '9\.9\.8' does not satisfy.*supported by this SDK/, ), ).toBeVisible(); }); From 4d7215c2d485328374abd09bea62933e3686797e Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Thu, 9 Jul 2026 17:27:33 +0530 Subject: [PATCH 4/5] dummy push for failing CI Signed-off-by: kumaradityaraj --- .changeset/e2e-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/e2e-tests.md b/.changeset/e2e-tests.md index 7757f6e3..4233fabf 100644 --- a/.changeset/e2e-tests.md +++ b/.changeset/e2e-tests.md @@ -2,4 +2,4 @@ "@serverlessworkflow/diagram-editor": minor --- -Test: expand Playwright E2E coverage for diagram rendering and validation errors +Test: Expand Playwright E2E coverage for diagram rendering and validation errors From 44ce1de87a7d5e1763216a2f6ccb36eb3924a320 Mon Sep 17 00:00:00 2001 From: kumaradityaraj Date: Mon, 13 Jul 2026 17:53:51 +0530 Subject: [PATCH 5/5] resolved suggested changes Signed-off-by: kumaradityaraj --- .changeset/e2e-tests.md | 5 ----- .../tests-e2e/conditional-task.spec.ts | 2 -- .../tests-e2e/validation-error.spec.ts | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 .changeset/e2e-tests.md diff --git a/.changeset/e2e-tests.md b/.changeset/e2e-tests.md deleted file mode 100644 index 4233fabf..00000000 --- a/.changeset/e2e-tests.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@serverlessworkflow/diagram-editor": minor ---- - -Test: Expand Playwright E2E coverage for diagram rendering and validation errors diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts index 47576b60..df3a313b 100644 --- a/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/conditional-task.spec.ts @@ -29,7 +29,5 @@ test("diagram editor renders conditional task", async ({ page }) => { await expect(page.locator(".edge-label")).toContainText(".customer.age < 18"); - await expect(page.getByText("raiseErrorIfUnderage")).toBeVisible(); - await expect(page.getByText("RAISE", { exact: true })).toBeVisible(); }); diff --git a/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts index 5046192e..df614233 100644 --- a/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts +++ b/packages/serverless-workflow-diagram-editor/tests-e2e/validation-error.spec.ts @@ -23,7 +23,7 @@ test("renders document validation error in sidebar", async ({ page }) => { await expect(errors).toBeVisible(); await expect( errors.getByText( - /The DSL version of the workflow '9\.9\.8' does not satisfy.*supported by this SDK/, + /The DSL version of the workflow '\d\.\d\.\d' does not satisfy.*supported by this SDK/, ), ).toBeVisible(); });