Skip to content

E2E: QA: add acceptance tests for content versioning#22702

Open
andr317c wants to merge 8 commits intomainfrom
v17/QA/add-acceptance-tests-for-content-versioning
Open

E2E: QA: add acceptance tests for content versioning#22702
andr317c wants to merge 8 commits intomainfrom
v17/QA/add-acceptance-tests-for-content-versioning

Conversation

@andr317c
Copy link
Copy Markdown
Contributor

@andr317c andr317c commented May 4, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 4, 2026 21:04
@claude
Copy link
Copy Markdown

claude Bot commented May 4, 2026

Claude finished @andr317c's task in 2m 57s —— View job


PR Review

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

Adds 6 E2E acceptance tests for content rollback (versioning), along with two new API helpers for building test data and one new UI helper for the rollback cancel button.


Important

  • ContentVersioning.spec.ts:4: let contentId = ''; at module scope is unnecessary shared mutable state. Every test that reads contentId also sets it in its own body, so there's no reason for module-level scope. If tests are ever reordered, a test that reads contentId without setting it first would silently pick up a stale value. → Replace with a local const contentId = await ... inside each test that needs it. Fix this →

Suggestions

  • ContentVersioning.spec.ts:34 (and lines 54, 76, 97, 124, 145): waitForTimeout(ConstantHelper.wait.medium) is a 1-second hard-coded sleep used to wait for rollback version items to load. This is an established codebase pattern, but it makes tests slower and flakier on loaded CI machines. Consider exposing a waitForRollbackItems() helper on ContentUiHelper that awaits visibility of the .rollback-item selector instead.

  • ContentVersioning.spec.ts:28–30: The navigation sequence (goToBackOffice → goToSection → goToContentWithName) is repeated verbatim in 4 of 6 tests. A describe block with a shared beforeEach for the common path would reduce noise and make the unique parts of each test stand out more clearly.


Approved with Suggestions for improvement

Good to go, but please carefully consider the importance of the suggestions. The test coverage is well-structured and covers the key rollback scenarios (invariant, variant, name restore, cancel, audit trail, tree action). The two new DocumentApiHelper methods follow existing patterns cleanly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Playwright acceptance coverage around content rollback/versioning flows in the Backoffice, including audit trail verification and a new UI helper affordance for cancelling rollback.

Changes:

  • Introduces a new ContentVersioning.spec.ts suite covering rollback via info tab, tree action menu, audit trail, variants, name restoration, and cancel behavior.
  • Extends DocumentApiHelper with helpers to create published documents with two versions (invariant + en-US variant).
  • Extends ContentUiHelper with a locator + method to cancel the rollback modal.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/ContentVersioning.spec.ts New E2E tests validating rollback behavior, including audit trail and cancel scenarios.
tests/Umbraco.Tests.AcceptanceTest/lib/helpers/DocumentApiHelper.ts Adds API helpers to create content with two published versions to support rollback scenarios.
tests/Umbraco.Tests.AcceptanceTest/lib/helpers/ContentUiHelper.ts Adds a rollback-cancel button locator and click helper for the rollback modal.

Comment thread tests/Umbraco.Tests.AcceptanceTest/lib/helpers/DocumentApiHelper.ts Outdated
andr317c and others added 4 commits May 5, 2026 09:28
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