Skip to content

E2E: QA Added acceptance tests for AllowEditInvariantFromNonDefault setting in the nested block#22762

Open
nhudinh0309 wants to merge 24 commits into
mainfrom
v17/QA/allow-edit-invariant-setting-in-nested-block-tests
Open

E2E: QA Added acceptance tests for AllowEditInvariantFromNonDefault setting in the nested block#22762
nhudinh0309 wants to merge 24 commits into
mainfrom
v17/QA/allow-edit-invariant-setting-in-nested-block-tests

Conversation

@nhudinh0309

@nhudinh0309 nhudinh0309 commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds acceptance tests for the AllowEditInvariantFromNonDefault setting in the nested block

  • AllowEditInvariantFromNonDefault = False

No Outer Block List With Outer Element Outer Element Inner Block List with Inner Element Inner Element Text in Inner Element (under test) Default Language (EN) Non-Default Language (DA)
1 Varies By Culture Varies By Culture Varies By Culture Varies By Culture Varies By Culture ✓ Editable ✓ Editable
2 Varies By Culture Varies By Culture Varies By Culture Varies By Culture Shared ✓ Editable ✓ Editable
3 Varies By Culture Varies By Culture Varies By Culture Shared - ✓ Editable ✓ Editable
4 Varies By Culture Varies By Culture Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
5 Varies By Culture Varies By Culture Shared Varies By Culture Shared ✓ Editable ✓ Editable
6 Varies By Culture Varies By Culture Shared Shared - ✓ Editable ✓ Editable
7 Varies By Culture Shared Shared Varies By Culture Varies By Culture ✓ Editable ✗ Readonly
8 Varies By Culture Shared Shared Varies By Culture Shared ✓ Editable ✗ Readonly
9 Varies By Culture Shared Shared Shared - ✓ Editable ✓ Editable
10 Shared Varies By Culture Varies By Culture Varies By Culture Varies By Culture ✓ Editable ✓ Editable
11 Shared Varies By Culture Varies By Culture Varies By Culture Shared ✓ Editable ✓ Editable
12 Shared Varies By Culture Varies By Culture Shared - ✓ Editable ✓ Editable
13 Shared Varies By Culture Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
14 Shared Varies By Culture Shared Varies By Culture Shared ✓ Editable ✓ Editable
15 Shared Varies By Culture Shared Shared - ✓ Editable ✓ Editable
16 Shared Shared Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
17 Shared Shared Shared Varies By Culture Shared ✓ Editable ✗ Readonly
18 Shared Shared Shared Shared - ✓ Editable ✗ Readonly
  • AllowEditInvariantFromNonDefault = False

No Outer Block List With Outer Element Outer Element Inner Block List with Inner Element Inner Element Text in Inner Element (under test) Default Language (EN) Non-Default Language (DA)
1 Varies By Culture Varies By Culture Varies By Culture Varies By Culture Varies By Culture ✓ Editable ✓ Editable
2 Varies By Culture Varies By Culture Varies By Culture Varies By Culture Shared ✓ Editable ✓ Editable
3 Varies By Culture Varies By Culture Varies By Culture Shared - ✓ Editable ✓ Editable
4 Varies By Culture Varies By Culture Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
5 Varies By Culture Varies By Culture Shared Varies By Culture Shared ✓ Editable ✓ Editable
6 Varies By Culture Varies By Culture Shared Shared - ✓ Editable ✓ Editable
7 Varies By Culture Shared Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
8 Varies By Culture Shared Shared Varies By Culture Shared ✓ Editable ✓ Editable
9 Varies By Culture Shared Shared Shared - ✓ Editable ✓ Editable
10 Shared Varies By Culture Varies By Culture Varies By Culture Varies By Culture ✓ Editable ✓ Editable
11 Shared Varies By Culture Varies By Culture Varies By Culture Shared ✓ Editable ✓ Editable
12 Shared Varies By Culture Varies By Culture Shared - ✓ Editable ✓ Editable
13 Shared Varies By Culture Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
14 Shared Varies By Culture Shared Varies By Culture Shared ✓ Editable ✓ Editable
15 Shared Varies By Culture Shared Shared - ✓ Editable ✓ Editable
16 Shared Shared Shared Varies By Culture Varies By Culture ✓ Editable ✓ Editable
17 Shared Shared Shared Varies By Culture Shared ✓ Editable ✓ Editable
18 Shared Shared Shared Shared - ✓ Editable ✓ Editable

@claude

claude Bot commented May 8, 2026

Copy link
Copy Markdown

Claude finished @nhudinh0309's task in 4m 10s —— View job


PR Review

Target: origin/main · Based on commit: e26a0aee
· Classified as: Test-only

Adds 36 Playwright E2E tests covering the AllowEditInvariantFromNonDefault setting across 18 nested-block variance combinations, for both the False (ContentSettingConfig) and True (DefaultConfig) configurations. Includes new helper methods for creating nested block list document types, creating multi-variant documents, and navigating/asserting block workspace properties.


Important

tests/Umbraco.Tests.AcceptanceTest/lib/helpers/ContentUiHelper.ts:1852 and :1857: Missing space between 'Add' and blockName in isAddBlockListElementWithNameDisabled and isAddBlockListElementWithNameVisible. The sibling method clickAddBlockListElementWithName at line 1847 correctly uses 'Add ' + blockName (note the trailing space), but the two methods below use 'Add' + blockName, producing e.g. "AddBlockList" instead of "Add BlockList". Both methods are actively called in existing tests (AllowEditInvariantFromNonDefaultIsFalse.spec.ts:155, AllowEditInvariantFromNonDefaultIsTrue.spec.ts:127,155), so this will cause those locators to silently not match.

// Line 1852 — fix:
const createNewButtonLocator = this.page.getByTestId(`property:${blockName.toLowerCase()}`).locator('uui-button').filter({hasText: 'Add ' + blockName});
// Line 1857 — fix:
const createNewButtonLocator = this.page.getByTestId(`property:${blockName.toLowerCase()}`).locator('uui-button').filter({hasText: 'Add ' + blockName});

Fix this →


tests/Umbraco.Tests.AcceptanceTest/package.json:26: The smokeTest script was repurposed to only execute the two new nested block spec files, removing all other tests previously covered by the @smoke suite. This looks like a development shortcut left in accidentally. Restore the original pattern (or tag the new tests @smoke and keep the generic grep).

// Restore to:
"smokeTest": "npm run build && npx playwright test DefaultConfig --grep \"@smoke\"",

Fix this →


Suggestions

  • ...IsFalseNestedBlocks.spec.ts and ...IsTrueNestedBlocks.spec.ts: The two 145-line files are structurally identical — same imports, beforeEach/afterEach, formatCombo, and the full Act block. Only the daEditable values in matrixCases differ. Extracting shared scaffolding into a helper would halve the maintenance surface, though the flat style is consistent with neighbouring spec files.

  • DocumentTypeApiHelper.ts:1226: require('crypto') is used inline, matching the existing pattern in the file. ES module import { randomUUID } from 'crypto' at the top would be cleaner if the file is ever migrated.


Request Changes

The missing space in the two ContentUiHelper locators will silently break existing passing tests, and the repurposed smokeTest script removes coverage from the smoke suite. Both should be addressed before merging.

@andr317c andr317c 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.

Had a few comments

Comment thread tests/Umbraco.Tests.AcceptanceTest/lib/helpers/DocumentApiHelper.ts
Comment thread tests/Umbraco.Tests.AcceptanceTest/lib/helpers/DocumentTypeApiHelper.ts Outdated

@andr317c andr317c 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.

LGTM

@andr317c andr317c enabled auto-merge (squash) June 25, 2026 11:34
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants