Skip to content

[DRAFT] Playwright tests - #858

Draft
sofiaIvarsRitense wants to merge 16 commits into
next-minorfrom
story/building-block-management-tests
Draft

[DRAFT] Playwright tests#858
sofiaIvarsRitense wants to merge 16 commits into
next-minorfrom
story/building-block-management-tests

Conversation

@sofiaIvarsRitense

Copy link
Copy Markdown
Contributor

Describe the changes

Link to the related Github issue:

Specify the code branch location:

Relevant comments:

Breaking changes

  • The contribution only contains changes that are not breaking.

Documentation

  • Release notes have been written for these changes.

New features or changes that have been introduced have been documented.

  • Yes
  • Not applicable

Tests

Unit tests have been added that cover these changes

  • Yes
  • Not applicable

Integration tests have been added that cover these changes

  • Yes
  • Not applicable

Describe the testing steps

  • Step 1
  • Step 2
  • Step 3

Security

The Secure by Design principle has been applied to these changes

  • Yes
  • Not applicable

Added or changed REST API endpoints have authentication and authorization in place

  • Yes
  • Not applicable

Valtimo access control checks have been implemented

  • Yes
  • Not applicable

Dependencies

Newly added dependencies do not introduce known vulnerabilities/CVE's and are in line with the Valtimo license

  • Yes
  • Not applicable

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f840741-26f6-4cf0-929f-ce006b4cc6a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end coverage from 70.5% to 81.5%.
    • Added coverage for dashboards, process and building block management, document editing, versioning, uploads, validation, role-based visibility, search, refresh, navigation, and unsupported widgets.
    • Improved reliability for dependent workflows, dropdown interactions, task claiming, and cleanup.
  • Chores
    • CI now retains Playwright videos only for failed tests, reducing unnecessary artifacts.

Walkthrough

Expanded Playwright coverage for building block management, document editing, process management, and user dashboards. Added page objects, API helpers, shared schema, overflow-menu, and toggle utilities. Added stable frontend test identifiers and dashboard endpoint definitions. Improved E2E reliability through serial execution, scoped dropdown selection, state polling, guarded cleanup, and failure-only CI video retention. Updated documented coverage totals and scenarios.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch story/building-block-management-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sofiaIvarsRitense sofiaIvarsRitense changed the title [DRAFT] Story/building block management tests [DRAFT] Building block management tests Jul 28, 2026
@sofiaIvarsRitense

Copy link
Copy Markdown
Contributor Author

Draft pull request until this pull request is merged: #798

@sofiaIvarsRitense
sofiaIvarsRitense marked this pull request as ready for review August 4, 2026 13:43
@sofiaIvarsRitense
sofiaIvarsRitense requested a review from a team as a code owner August 4, 2026 13:43
@sofiaIvarsRitense sofiaIvarsRitense changed the title [DRAFT] Building block management tests Building block management tests Aug 4, 2026
# Conflicts:
#	e2e/tests/access-control/access-control.spec.ts
#	e2e/tests/access-control/page.ts
#	e2e/tests/case-details-management-form-flows/page.ts
#	e2e/tests/case-details-management-tabs/page.ts
#	e2e/tests/case-details-management-tasks/page.ts
#	e2e/tests/case-details-management-widgets/case-details-management-widgets.ts
#	e2e/tests/case-details-management-widgets/page.ts
#	e2e/tests/case-details-management/case-details-management.spec.ts
#	e2e/tests/iko/iko-search-action/page.ts
#	e2e/tests/iko/iko-search-field/page.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
e2e/tests/case-details-management-tasks/case-details-management-tasks.spec.ts (1)

59-65: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard teardown against incomplete beforeAll setup.

Setup failures run afterAll, but the cleanup still reads values assigned by setup. Do not mask the setup failure with a second teardown error: guard tasksPage in the tasks spec, and guard widgetsPage, draftVersion, and widgetTabKey in the widgets spec before calling the API cleanup methods.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: efb59e9f-88c4-4050-9e23-a86645820623

📥 Commits

Reviewing files that changed from the base of the PR and between f2c2e32 and 5c54e97.

⛔ Files ignored due to path filters (3)
  • e2e/assets/building-block-archives/e2e-building-block-artwork.png is excluded by !**/*.png
  • e2e/assets/building-block-archives/e2e-building-block-import-invalid-file.zip is excluded by !**/*.zip
  • e2e/assets/building-block-archives/e2e-building-block-import-success_1.0.0.zip is excluded by !**/*.zip
📒 Files selected for processing (56)
  • e2e/TEST_COVERAGE.md
  • e2e/constants/building-block-management-test-ids.ts
  • e2e/constants/components-test-ids.ts
  • e2e/constants/index.ts
  • e2e/playwright.config.ts
  • e2e/shared/overflow-menu/overflow-menu.utils.ts
  • e2e/shared/schema-editor/schema-editor.utils.ts
  • e2e/tests/access-control/access-control.spec.ts
  • e2e/tests/access-control/page.ts
  • e2e/tests/building-block-details-management-document/building-block-document-config.ts
  • e2e/tests/building-block-details-management-document/building-block-document.spec.ts
  • e2e/tests/building-block-details-management-document/page.ts
  • e2e/tests/building-block-details-management/building-block-details-config.ts
  • e2e/tests/building-block-details-management/building-block-details-management.spec.ts
  • e2e/tests/building-block-details-management/page.ts
  • e2e/tests/building-block-management/building-block-config.ts
  • e2e/tests/building-block-management/building-block-management.spec.ts
  • e2e/tests/building-block-management/page.ts
  • e2e/tests/case-details-management-form-flows/case-details-management-form-flows.spec.ts
  • e2e/tests/case-details-management-form-flows/page.ts
  • e2e/tests/case-details-management-search-fields/page.ts
  • e2e/tests/case-details-management-tabs/case-details-management-tabs.spec.ts
  • e2e/tests/case-details-management-tabs/page.ts
  • e2e/tests/case-details-management-tasks/case-details-management-tasks.spec.ts
  • e2e/tests/case-details-management-tasks/page.ts
  • e2e/tests/case-details-management-widgets/case-details-management-widgets.spec.ts
  • e2e/tests/case-details-management-widgets/case-details-management-widgets.ts
  • e2e/tests/case-details-management-widgets/page.ts
  • e2e/tests/case-details-management/case-details-management.spec.ts
  • e2e/tests/iko/iko-search-action/page.ts
  • e2e/tests/iko/iko-search-field/page.ts
  • e2e/tests/task-list/page.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-artwork/building-block-management-artwork.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-artwork/building-block-management-artwork.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-detail/building-block-management-detail.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-detail/building-block-management-detail.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-list/building-block-management-list.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-list/building-block-management-list.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-metadata/building-block-management-metadata.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-metadata/building-block-management-metadata.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-plugins/building-block-management-plugins.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-plugins/building-block-management-plugins.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.html
  • frontend/projects/valtimo/building-block-management/src/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.ts
  • frontend/projects/valtimo/building-block-management/src/lib/constants/building-block-management.test-ids.ts
  • frontend/projects/valtimo/building-block-management/src/lib/constants/index.ts
  • frontend/projects/valtimo/building-block-management/src/public-api.ts
  • frontend/projects/valtimo/components/src/lib/components/schema-editor/schema-editor.component.html
  • frontend/projects/valtimo/components/src/lib/components/schema-editor/schema-editor.component.ts
  • frontend/projects/valtimo/components/src/lib/constants/components.test-ids.ts

Comment on lines +1 to +11
export {
BUILDING_BLOCK_MANAGEMENT_LIST_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_CREATE_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_UPLOAD_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_METADATA_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_ARTWORK_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_PLUGINS_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_ACTIONS_TEST_IDS,
BUILDING_BLOCK_VERSION_OPTION_TEST_ID_PREFIX,
} from '../../frontend/projects/valtimo/building-block-management/src/lib/constants/building-block-management.test-ids';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the required license header.

This TypeScript file starts with export on Line 1. Add the standard EUPL header before the first export.

Proposed header
+/*
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
+ *
+ * Licensed under EUPL, Version 1.2 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
+ *
+ * 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.
+ */
 export {

As per path instructions, TypeScript files must start with the standard EUPL license header.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export {
BUILDING_BLOCK_MANAGEMENT_LIST_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_CREATE_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_UPLOAD_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_METADATA_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_ARTWORK_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_PLUGINS_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_ACTIONS_TEST_IDS,
BUILDING_BLOCK_VERSION_OPTION_TEST_ID_PREFIX,
} from '../../frontend/projects/valtimo/building-block-management/src/lib/constants/building-block-management.test-ids';
/*
* Copyright 2015-2026 Ritense BV, the Netherlands.
*
* Licensed under EUPL, Version 1.2 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* 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.
*/
export {
BUILDING_BLOCK_MANAGEMENT_LIST_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_CREATE_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_UPLOAD_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_METADATA_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_ARTWORK_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_PLUGINS_TEST_IDS,
BUILDING_BLOCK_MANAGEMENT_DETAIL_ACTIONS_TEST_IDS,
BUILDING_BLOCK_VERSION_OPTION_TEST_ID_PREFIX,
} from '../../frontend/projects/valtimo/building-block-management/src/lib/constants/building-block-management.test-ids';

Source: Path instructions

Comment thread e2e/constants/index.ts
@@ -1,3 +1,4 @@
export * from './building-block-management-test-ids';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the required license header.

Line 1 starts with code. Prepend the standard EUPL license header before this export.

As per path instructions, each *.ts file must start with the standard license header.

Source: Path instructions

Comment thread e2e/tests/access-control/page.ts Outdated
Comment on lines +148 to +153
async deleteBuildingBlockViaApi(key: string, versionTag: string) {
try {
await apiDelete(`${BUILDING_BLOCK_API_URL}/${key}/version/${versionTag}`);
} catch {
// No DELETE endpoint yet — nothing to do.
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Inspect the API helper error contract before narrowing the catch block.
ast-grep outline e2e/utils/api.utils.ts --items all
rg -n -C 8 '\b(apiDelete|apiPost|apiPut)\b' e2e/utils/api.utils.ts || true

# Find a supported delete endpoint or an explicit E2E database-reset mechanism.
rg -n -C 8 --glob '*.{kt,java,ts}' \
  '\bBuildingBlockManagementResource\b|`@DeleteMapping`|\bDELETE\b' . || true
rg -n -i -C 4 \
  '((e2e|playwright).*(database|db).*(reset|clean|cleanup)|(reset|clean|cleanup).*(database|db))' . || true

Repository: valtimo-platform/valtimo

Length of output: 50381


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "tracked e2e files of interest:"
git ls-files 'e2e/tests/building-block-details-management-document/*' 'e2e/tests/building-blocks*' 'e2e/**/*.ts' | sed -n '1,200p'

echo
echo "page.ts relevant section:"
sed -n '1,220p' e2e/tests/building-block-details-management-document/page.ts

echo
echo "spec.ts relevant sections:"
sed -n '1,220p' e2e/tests/building-block-details-management-document/building-block-document.spec.ts 2>/dev/null || true
fd -a 'building-block-document\.spec\.ts$' . | xargs -r sed -n '1,220p'

echo
echo "api.utils concise:"
sed -n '1,220p' e2e/utils/api.utils.ts 2>/dev/null || true

echo
echo "focused resource/deletion searches:"
rg -n --glob '*.{kt,java,ts}' --glob '!e2e/**/*common*' \
  'BuildingBlockManagementResource|BuildingBlockResource|BuildingBlock|`@DeleteMapping`|deleteBuildingBlock|versionTag|ManagementDocument' . | sed -n '1,240p'

echo
echo "focused cleanup/reset phrases in e2e:"
rg -n -i --glob 'e2e/**/*.{ts,kt,java,yml,yaml,properties,json}' \
  'reset|restore|cleanup|clean|flush|database|db\.' e2e | sed -n '1,240p' || true

Repository: valtimo-platform/valtimo

Length of output: 50380


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "Focused building block management resource:"
rg -n --glob '*.{kt,java}' 'class BuildingBlockManagementResource|`@RestController`|`@RequestMapping`|`@GetMapping`|`@PostMapping`|`@PutMapping`|`@DeleteMapping`' backend e2e | sed -n '1,240p'

echo
echo "Focused building block deletion references in backend:"
rg -n --glob '*.{kt,java}' 'BuildingBlockManagementResource|BuildingBlockDefinitionRepository|deleteBy.*Key|delete.*Definition|versionTag' backend/building-block backend e2e/tests/building-block* e2e/utils/api.utils.ts | sed -n '1,260p'

echo
echo "Focused e2e teardown/reset/cleanup:"
rg -n --glob 'e2e/**/*.{ts,yml,yaml,properties,json}' -i \
  'globalTeardown|globalSetup|afterAll|database|db\.|reset|restore|cleanup|clean|h2|flyway|liquibase' e2e | sed -n '1,260p'

Repository: valtimo-platform/valtimo

Length of output: 50381


Remove the generated fixture after the suite.

This suite creates a unique building block in beforeAll. deleteBuildingBlockViaApi() calls /version/{versionTag}, which is unsupported by BuildingBlockManagementResource GET/POST/PUT, and ignores all cleanup failures. That leaves a persistent E2E record until an external cleanup occurs. Add a supported fixture deletion path, or make the E2E reset policy an explicit suite contract. Surface cleanup failures except for the known unsupported DELETE status.

Comment on lines +68 to +79
test.afterAll(async () => {
// Artwork can be removed; the building block itself cannot — there is no
// DELETE endpoint for building block definitions (see
// `deleteBuildingBlockViaApi`). Both versions created here stay behind until
// that endpoint exists.
for (const versionTag of [initialVersion, draftVersion]) {
await detailsPage.deleteArtworkViaApi(buildingBlockKey, versionTag);
}

for (const versionTag of [draftVersion, initialVersion]) {
await detailsPage.deleteBuildingBlockViaApi(buildingBlockKey, versionTag);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect source only. Do not execute repository code.
rg -n -C 3 --glob '*.{ts,js,mjs,cjs,yml,yaml,json,sh}' \
  'globalSetup|globalTeardown|reset.*(database|data|environment)|truncate|drop.*(database|schema)|cleanup' \
  . || true

rg -n -C 4 --glob '*.ts' \
  '\b(deleteBuildingBlockViaApi|deleteArtworkViaApi|apiDelete)\b' \
  e2e

Repository: valtimo-platform/valtimo

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Candidate e2e config files:\n'
git ls-files | rg '(^|/)(playwright|package|buildkite|gha|ci|docker|k8s|helm|application).*\.(ya?ml|json|ts|js|mjs|cjs)$|(^|/)e2e/.*\.(ya?ml|json|ts|js|mjs|cjs)$' || true

printf '\nE2E-related mentions in config/docs/scripts:\n'
rg -n --hidden --glob '!node_modules/**' --glob '!target/**' --glob '!dist/**' --glob '!build/**' \
  'e2e|playwright|globalSetup|globalTeardown|afterAll|deleteBuildingBlockViaApi|deleteArtworkViaApi' \
  package.json .github e2e scripts || true

printf '\nRelevant page helper snippets:\n'
sed -n '430,475p' e2e/tests/building-block-details-management/page.ts
sed -n '332,366p' e2e/tests/building-block-management/page.ts

printf '\nRelevant spec teardown snippets:\n'
sed -n '55,85p' e2e/tests/building-block-details-management/building-block-details-management.spec.ts
sed -n '45,70p' e2e/tests/building-block-management/building-block-management.spec.ts

Repository: valtimo-platform/valtimo

Length of output: 50380


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Playwright config:\n'
cat -n e2e/playwright.config.ts

printf '\nTeardown utility:\n'
cat -n e2e/utils/teardown.ts

printf '\nGlobal setup utility, summary:\n'
wc -l e2e/utils/globalSetup.ts
sed -n '1,180p' e2e/utils/globalSetup.ts

printf '\nAPI DELETE helper:\n'
sed -n '58,90p' e2e/utils/api.utils.ts

printf '\nBuilding block definitions:\n'
rg -n --glob '*.java' 'class BuildingBlockManagementResource|`@DeleteMapping`|DELETE.*building|version.*building|building-block' backend e2e || true

Repository: valtimo-platform/valtimo

Length of output: 10347


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Exact building-block API resource files:\n'
rg -n --glob '*.java' 'BuildingBlockManagementResource|`@RestController`|`@RequestMapping`|/building-block|building/block|processVersionTag|artifact' backend | head -200

printf '\nBuilding-block management page helper complete relevant area:\n'
sed -n '38,55p;340,362p' e2e/tests/building-block-management/page.ts

printf '\nBuilding-block details management page helper complete relevant area:\n'
sed -n '38,48p;435,465p' e2e/tests/building-block-details-management/page.ts

printf '\nBuilding-block specs setup/creation/teardown:\n'
sed -n '50,80p' e2e/tests/building-block-management/building-block-management.spec.ts
sed -n '60,80p' e2e/tests/building-block-details-management/building-block-details-management.spec.ts

printf '\nAPI helper full read-only body:\n'
wc -l e2e/utils/api.utils.ts
sed -n '1,180p' e2e/utils/api.utils.ts

Repository: valtimo-platform/valtimo

Length of output: 17246


Handle missing DELETE support in the teardown helpers.

apiDelete() rejects unexpected responses, so deleteBuildingBlockViaApi() can still leave teardown failures unlogged while swallowing 404/405 when the endpoint is missing. Keep deleting 404/405 for this helper, but rethrow other failures. Add a comment noting these E2E suites currently leave built building-block versions behind until a DELETE endpoint exists.

📍 Affects 4 files
  • e2e/tests/building-block-details-management/building-block-details-management.spec.ts#L68-L79 (this comment)
  • e2e/tests/building-block-details-management/page.ts#L446-L468
  • e2e/tests/building-block-management/building-block-management.spec.ts#L53-L63
  • e2e/tests/building-block-management/page.ts#L344-L359

Comment on lines +248 to +253
/**
* These tests share one building block and run in declaration order: the draft
* has to be finalized before a new draft can be created, and both versions have
* to exist before they can be switched between.
*/
test.describe('13.18–13.22 — Version lifecycle', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect configuration only. Do not execute tests.
fd -0 -t f -a 'playwright\.config\.(ts|js|mjs|cjs)$' . |
  xargs -0 -r rg -n -C 3 'fullyParallel|workers|mode\s*:'

rg -n -C 3 \
  'test\.describe(\.serial|\.parallel)?|test\.describe\.configure|mode\s*:' \
  e2e/tests/building-block-details-management/building-block-details-management.spec.ts

Repository: valtimo-platform/valtimo

Length of output: 3350


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the version lifecycle tests and top-level test declarations without running repository code.
sed -n '240,335p' e2e/tests/building-block-details-management/building-block-details-management.spec.ts
printf '\n--- all test.describe/define/config mode references ---\n'
rg -n -C 2 'test\.define|test\.describe(\.serial|\.configure|\.parallel)?|mode\s*:\s*["'\'']\w+["'\'']|fullyParallel|workers|CI' e2e/tests e2e -g '*.ts' -g '*.config.*'

Repository: valtimo-platform/valtimo

Length of output: 50381


Declare the version lifecycle group as serial.

This group has order-dependent prerequisities within tests that share buildingBlockKey. With the project fullyParallel setting, tests can run in separate workers unless they run in one process via .describe.serial / test.describe.configure({mode: 'serial'}).

Proposed change
-test.describe('13.18–13.22 — Version lifecycle', () => {
+test.describe.serial('13.18–13.22 — Version lifecycle', () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* These tests share one building block and run in declaration order: the draft
* has to be finalized before a new draft can be created, and both versions have
* to exist before they can be switched between.
*/
test.describe('13.18–13.22 — Version lifecycle', () => {
/**
* These tests share one building block and run in declaration order: the draft
* has to be finalized before a new draft can be created, and both versions have
* to exist before they can be switched between.
*/
test.describe.serial('13.18–13.22 — Version lifecycle', () => {

Source: MCP tools

Comment on lines +436 to +443
async getArtworkViaApi(key: string, versionTag: string): Promise<{imageBase64: string} | null> {
try {
return await apiGet<{imageBase64: string}>(
`${BUILDING_BLOCK_API_URL}/${key}/version/${versionTag}/artwork`
);
} catch {
return null;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Propagate unexpected artwork read failures.

getArtworkViaApi converts every apiGet exception to null. The deletion test in e2e/tests/building-block-details-management/building-block-details-management.spec.ts, Line 223 treats null as proof that deletion succeeded. A server, authorization, or transport failure can therefore pass the deletion check. Return null only for the expected no-artwork response. Rethrow all other errors.

Comment on lines 52 to +54
test.afterAll(async () => {
await formFlowsPage.deleteFormFlowViaApi(formFlowTestData.key);
await context.close();
if (context) await context.close();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files:"
git ls-files 'e2e/tests/*spec.ts' | sed -n '1,80p'

echo
for f in \
  e2e/tests/case-details-management-form-flows/case-details-management-form-flows.spec.ts \
  e2e/tests/case-details-management-tabs/case-details-management-tabs.spec.ts
do
  echo "===== $f ====="
  wc -l "$f"
  sed -n '1,120p' "$f"
done

Repository: valtimo-platform/valtimo

Length of output: 11642


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Page object declarations and teardown patterns:"
rg -n "let .*Page|beforeAll|afterAll|close\\(\\)|deleteFormFlowViaApi|deleteTabViaApi" e2e/tests/case-details-management-form-flows/case-details-management-form-flows.spec.ts e2e/tests/case-details-management-tabs/case-details-management-tabs.spec.ts -C 3

Repository: valtimo-platform/valtimo

Length of output: 9179


Guard teardown cleanup against failed test setup.

If test.beforeAll fails before formFlowsPage/tabsPage is assigned, test.afterAll runs and calls the undefined page object directly, hiding the original setup failure. Run the API deletions only when the page object exists first; then close context when available.

📍 Affects 2 files
  • e2e/tests/case-details-management-form-flows/case-details-management-form-flows.spec.ts#L52-L54 (this comment)
  • e2e/tests/case-details-management-tabs/case-details-management-tabs.spec.ts#L59-L70

Comment on lines 37 to +53
<ng-template #buildingBlockDefinitionActions>
<div class="valtimo-building-block-management-list__actions">
<button cdsButton="ghost" (click)="showUploadModal()">
<button
[attr.data-test-id]="testIds.uploadButton"
cdsButton="ghost"
(click)="showUploadModal()"
>
{{ 'Upload' | translate }}

<svg cdsIcon="upload" size="16" class="cds--btn__icon"></svg>
</button>

<button cdsButton="primary" (click)="showCreateModal()">
<button
[attr.data-test-id]="testIds.createButton"
cdsButton="primary"
(click)="showCreateModal()"
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Scope the list action locators to one rendered action set.

buildingBlockDefinitionActions is rendered in both the toolbar and valtimo-no-results. When the list is empty, both new test IDs match two buttons. e2e/tests/building-block-management/page.ts, Line 70, uses page.getByTestId(...) globally, so Playwright strict mode will fail before the first building block can be created or uploaded. Scope the page-object locators to the toolbar, or assign distinct IDs to the empty-state actions.

Proposed locator fix
- return this.page.getByTestId(BUILDING_BLOCK_MANAGEMENT_LIST_TEST_IDS.uploadButton);
+ return this.page
+   .getByLabel('Table action bar')
+   .getByTestId(BUILDING_BLOCK_MANAGEMENT_LIST_TEST_IDS.uploadButton);

Apply the same scope to createButton.

Comment on lines +232 to +238
/**
* Test id for a required-field checkbox, keyed on the property's full path so
* that a property name repeated at another object level stays unique.
*/
protected requiredPropertyTestId(path: string[], property: string): string {
return `${SCHEMA_EDITOR_REQUIRED_PROPERTY_TEST_ID_PREFIX}${[...(path ?? []), property].join('.')}`;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use an injective required-property test ID.

A dot-joined path is ambiguous. A root address.street property and nested addressstreet property produce the same test ID. This creates duplicate data-test-id values and strict Playwright locator failures.

  • frontend/projects/valtimo/components/src/lib/components/schema-editor/schema-editor.component.ts#L232-L238: encode each path segment before joining it.
  • e2e/shared/schema-editor/schema-editor.utils.ts#L184-L187: use the identical segment encoding when creating the locator.
  • frontend/projects/valtimo/components/src/lib/constants/components.test-ids.ts#L31-L37: document the encoded path format.
Proposed fix
- return `${SCHEMA_EDITOR_REQUIRED_PROPERTY_TEST_ID_PREFIX}${[...(path ?? []), property].join('.')}`;
+ return `${SCHEMA_EDITOR_REQUIRED_PROPERTY_TEST_ID_PREFIX}${[...(path ?? []), property]
+   .map(segment => encodeURIComponent(segment).replace(/\./g, '%2E'))
+   .join('.')}`;
- `${SCHEMA_EDITOR_REQUIRED_PROPERTY_TEST_ID_PREFIX}${path.join('.')}`
+ `${SCHEMA_EDITOR_REQUIRED_PROPERTY_TEST_ID_PREFIX}${path
+   .map(segment => encodeURIComponent(segment).replace(/\./g, '%2E'))
+   .join('.')}`
📍 Affects 3 files
  • frontend/projects/valtimo/components/src/lib/components/schema-editor/schema-editor.component.ts#L232-L238 (this comment)
  • e2e/shared/schema-editor/schema-editor.utils.ts#L184-L187
  • frontend/projects/valtimo/components/src/lib/constants/components.test-ids.ts#L31-L37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: efdb49d3-08c7-4ef0-bc4b-517d684f9023

📥 Commits

Reviewing files that changed from the base of the PR and between 5c54e97 and 713ee44.

📒 Files selected for processing (13)
  • e2e/TEST_COVERAGE.md
  • e2e/api/endpoints.ts
  • e2e/constants/dashboard-test-ids.ts
  • e2e/constants/index.ts
  • e2e/tests/user-dashboard/page.ts
  • e2e/tests/user-dashboard/user-dashboard-config.ts
  • e2e/tests/user-dashboard/user-dashboard.spec.ts
  • frontend/projects/valtimo/dashboard/src/lib/components/widget-dashboard-content/widget-dashboard-content.component.html
  • frontend/projects/valtimo/dashboard/src/lib/components/widget-dashboard-content/widget-dashboard-content.component.ts
  • frontend/projects/valtimo/dashboard/src/lib/components/widget-dashboard/widget-dashboard.component.html
  • frontend/projects/valtimo/dashboard/src/lib/components/widget-dashboard/widget-dashboard.component.ts
  • frontend/projects/valtimo/dashboard/src/lib/constants/dashboard.test-ids.ts
  • frontend/projects/valtimo/dashboard/src/lib/constants/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/constants/index.ts

Comment thread e2e/api/endpoints.ts
Comment on lines +14 to +23
/**
* User-facing dashboard endpoints (as consumed by the dashboard shown on `/`).
* These are filtered by the caller's role via access-control permissions, so they
* only return dashboards the current user is allowed to view.
*/
userDashboard: {
getAll: '/api/v1/dashboard',
data: (dashboardKey: string) => `/api/v1/dashboard/${dashboardKey}/data`,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add the standard EUPL license header at the start of this file.

Line 14 starts code before the required TypeScript header can end. Add the repository standard header before all code. As per path instructions, each .ts file must start with the standard EUPL header.

Source: Path instructions

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
e2e/tests/process-management/page.ts (2)

465-473: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

The catch-all hides real API failures.

getProcessVersionsViaApi returns [] for every thrown error. A 500 response, an auth failure, or a network error then looks identical to "no deployed versions".

The spec relies on this result for assertions. At process-management.spec.ts line 338 the test asserts toHaveLength(0) after a delete, and at lines 290 and 159 it compares counts. A transient failure makes those assertions pass incorrectly.

Narrow the catch to the 404 (or whichever status the API returns for an unknown key) and rethrow everything else.


59-66: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused APIRequestContext plumbing. ProcessManagementPage stores and receives the context, but its API methods call the shared apiGet/apiDelete helpers instead. api.utils.ts creates and disposes a module-level context independently, so this request parameter is dead code. Also remove the unused APIRequestContext import from e2e/tests/process-management/page.ts.

e2e/tests/process-management/process-management.spec.ts (1)

43-45: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Type the shared fixtures and drop the unused request variable.

context, page, and request are declared without types, so they are implicitly any and lose all editor and compiler checking. request is also only read once, at line 56, to construct the page object.

♻️ Proposed refactor
-import {expect, test} from '`@playwright/test`';
+import {type BrowserContext, type Page, expect, test} from '`@playwright/test`';
-  let context;
-  let page;
-  let request;
+  let context: BrowserContext;
+  let page: Page;
   let processPage: ProcessManagementPage;
     context = await browser.newContext({baseURL});
     page = await context.newPage();
-    request = context.request;
 
-    processPage = new ProcessManagementPage(page, request);
+    processPage = new ProcessManagementPage(page, context.request);

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: df5f8858-d41d-45b9-81e4-35902c3f5356

📥 Commits

Reviewing files that changed from the base of the PR and between 713ee44 and ba55011.

📒 Files selected for processing (10)
  • e2e/TEST_COVERAGE.md
  • e2e/constants/process-management-test-ids.ts
  • e2e/shared/carbon-toggle/carbon-toggle.utils.ts
  • e2e/tests/process-management/page.ts
  • e2e/tests/process-management/process-management-config.ts
  • e2e/tests/process-management/process-management.spec.ts
  • frontend/projects/valtimo/process-management/src/lib/components/process-management-builder/process-management-builder.component.html
  • frontend/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.html
  • frontend/projects/valtimo/process-management/src/lib/components/process-management-upload/process-management-upload.component.ts
  • frontend/projects/valtimo/process-management/src/lib/constants/process-management.test-ids.ts

Comment on lines +42 to +49
test.describe('Process management — standalone processes', () => {
let context;
let page;
let request;
let processPage: ProcessManagementPage;

/** Every process key this suite may create, deleted in `afterAll`. */
const createdProcessKeys: string[] = [UPLOADED_PROCESS.key, CREATED_PROCESS.key];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Declare this suite as serial.

The tests in this file depend on each other. The comment at lines 38-40 states the order: the upload test seeds version 1, the edit test saves version 2, and the version tests assert against both. The delete test then removes the key.

All tests also share one page and one context created in beforeAll. Without serial mode, a failing test does not stop the ones that follow, and a retry re-runs a single test against mutated state. Both produce cascading and misleading failures.

Other specs in this PR were changed to serial execution. Apply the same configuration here.

🛠️ Proposed fix
 test.describe('Process management — standalone processes', () => {
+  test.describe.configure({mode: 'serial'});
+
   let context;
   let page;
   let request;
   let processPage: ProcessManagementPage;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test.describe('Process management — standalone processes', () => {
let context;
let page;
let request;
let processPage: ProcessManagementPage;
/** Every process key this suite may create, deleted in `afterAll`. */
const createdProcessKeys: string[] = [UPLOADED_PROCESS.key, CREATED_PROCESS.key];
test.describe('Process management — standalone processes', () => {
test.describe.configure({mode: 'serial'});
let context;
let page;
let request;
let processPage: ProcessManagementPage;
/** Every process key this suite may create, deleted in `afterAll`. */
const createdProcessKeys: string[] = [UPLOADED_PROCESS.key, CREATED_PROCESS.key];

Comment on lines +89 to +99
test('7.1 — Process list shows every unlinked process returned by the API', async () => {
const processes = await processPage.getProcessesViaApi();

await processPage.goToProcessManagement();

await expect(processPage.carbonList.rows).toHaveCount(processes.length);

for (const process of processes) {
await processPage.assertProcessVisible(process.processDefinition.key);
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the backend controller for the unlinked process-definition collection endpoint.
rg -nP -C6 'management/v1/process-definition' --type=kt --type=java

# Check how the frontend list component maps that response into rows.
fd -t f 'process-management-list.component.ts' frontend | xargs -r rg -nP -C6 'processDefinition|map\('

Repository: valtimo-platform/valtimo

Length of output: 3315


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Tracked files matching process-management.spec.ts / process-management-list.component.ts / process-definition APIs:"
git ls-files | rg '(^|/)(process-management\.spec\.ts|process-management-list\.component\.ts|.*ProcessDefinition.*Processor|.*Process.*Repository|.*ProcessDefinition.*Controller|.*ProcessDefinition.*Service).*\.(ts|kt|java)$' || true

echo
echo "Search endpoint strings in all tracked source files:"
rg -n -C4 'management/v1/process-definition|process-definition|ProcessDefinition|ProcessDefinitions|deployed version|unlinked' . --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' | head -n 300

echo
echo "Inspect e2e spec and page helper candidates:"
fd -t f 'process-management\.spec\.ts|page\.ts|process-management-list\.component\.ts' . | sed -n '1,80p'

Repository: valtimo-platform/valtimo

Length of output: 35484


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "process-management.spec.ts relevant lines:"
sed -n '80,105p' e2e/tests/process-management/process-management.spec.ts

echo
echo "process-management page.ts API/result interface lines:"
sed -n '40,75p' e2e/tests/process-management/page.ts
sed -n '458,473p' e2e/tests/process-management/page.ts

echo
echo "backend process-definition RestController candidates:"
rg -n -C5 '@(GetMapping|PostMapping|PutMapping|DeleteMapping).*process-definition|"/process-definition"|GetMapping.*/api/management/v1/process-definition|PostMapping.*/api/management/v1/process-definition' backend --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' || true

echo
echo "backend repository/service terms around unlinked process definitions:"
rg -n -C5 'unlinked|process-definition|ProcessDefinitionRepository|findAll|processDefinition.*key|find.*ProcessDefinition|processDefinition' backend --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' --glob '!**/src/test/**' | head -n 350

echo
echo "frontend list component relevant lines:"
sed -n '1,115p' frontend/projects/valtimo/process-management/src/lib/components/process-management-list/process-management-list.component.ts
sed -n '115,175p' frontend/projects/valtimo/process-management/src/lib/components/process-management-list/process-management-list.component.ts

echo
echo "frontend API/service endpoint definitions:"
rg -n -C4 'process-definition|processManagementService|processes\$\(' frontend --glob '*.ts' | head -n 300

Repository: valtimo-platform/valtimo

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "ProcessLinkResource unlinked endpoint implementation:"
sed -n '170,205p' backend/process-link/src/main/kotlin/com/ritense/processlink/web/rest/ProcessLinkResource.kt

echo
echo "Operaton process service methods:"
fd -t f 'OperatonProcessService.kt|OperatonProcessService.java' backend | xargs -r rg -n -C6 'fun getUnlinkedDeployedDefinitions|getUnlinkedDeployedDefinitions|getUnlinkedDeployed|getDeployedDefinitions|deployedDefinition' || true

echo
echo "Frontend list component service mapping:"
rg -n -C8 'processManagementService\.processes\$|processes\$|processManagementService|processManagementList|processDefinitions\$|processDefinition\.key' frontend/projects/valtimo/process-management/src/frontend/projects/valtimo/process-management/src/lib/components/process-management-list/process-management-list.component.ts frontend/projects/valtimo --glob '*.ts' | head -n 220

echo
echo "Locate ProcessManagementService definition:"
fd -t f 'process-management.*service.*\.(ts|js)$|process-management.*\.(ts|js)$' frontend/projects/valtimo | xargs -r rg -n -C4 'processes\$|processMgmt|process-definition|processDefinitions' || true

Repository: valtimo-platform/valtimo

Length of output: 39163


Compare with the key count, not the API row count.

getProcessesViaApi() returns one entry per deployed unlinked version, but the management list renders rows from processManagementService.processes$, not the collection endpoint. If any key has multiple versions, processes.length will compare against versions and can fail even when the key column is shown once. Deduplicate processes by processDefinition.key before comparing and asserting.

@sofiaIvarsRitense sofiaIvarsRitense changed the title Building block management tests [DRAFT] Playwright tests Aug 5, 2026
@sofiaIvarsRitense
sofiaIvarsRitense marked this pull request as draft August 5, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant