Conversation
|
Claude finished @oidacra's task in 4m 6s —— View job PR Review
Issues Found1.
The guard at line 277 ( 2. No test cleanup — content types accumulate — The fixture's Additionally, 3.
4. Serial mode comment is misleading — Most describe blocks have: This is inaccurate. A secondary risk: in serial mode, any test failure skips all subsequent tests in the block, which can hide failures. 5. onRowReorder(event: TableRowReorderEvent) {
const dragIndex = event?.dragIndex;
const dropIndex = event?.dropIndex;
if (this.$isDisabled() || dragIndex == null || dropIndex == null) {
return;
}
this.store.setData(this.store.data()); // dragIndex/dropIndex unused
}The variables are extracted, null-checked, then completely ignored. The comment explains that PrimeNG already mutates the array in-place, so the store just needs a snapshot. That's fine, but 6.
Not bugs, just noted:
|
|
Claude finished @oidacra's task in 1m 58s —— View job Rollback Safety Analysis
Result: ✅ Safe to Rollback All 33 changed files are confined to two areas:
Category-by-category verdict:
The frontend changes (circular dependency fix, |
…ependency in new edit mode - Fix signalMethod warning by passing value instead of signal in ngOnInit - Break circular dependency (NG0919) by lazy-loading DotEditContentDialogComponent - Add closable: true to new content dialog config - Add push/pop stack to AngularFormBridge for nested form contexts (dialogs) Closes #35022
…lationship fields - Introduced new fixture for relationship tests, including content type and contentlet definitions. - Implemented API helpers for creating, deleting, and managing content types and contentlets. - Added multiple test cases covering various scenarios for relationship fields, including creation, editing, and validation of relationships. - Enhanced existing page objects to support new functionalities related to relationship management. This update aims to improve the testing framework for relationship fields, ensuring robust coverage and reliability in the new edit content experience.
…pport - Added a constant for the standard SystemWorkflow ID across dotCMS instances. - Updated , , and functions to accept an optional parameter, allowing for dynamic workflow assignment. - Modified API helpers to utilize the new workflow ID parameter when creating content types. - Improved login page interaction by adding a tab press after filling the username input. This update enhances the flexibility of content type creation and improves user interaction in the login process.
…tionship tests - Added error handling for failed content type creation in , logging detailed error messages. - Updated locator strategies in to use more robust selectors, enhancing stability during interactions. - Refined test logic in to ensure proper visibility checks and response handling when saving inline content. - Adjusted helper methods in to use role-based locators for better maintainability. These changes aim to enhance the reliability and clarity of end-to-end tests for relationship fields and content creation workflows.
…tionship field tests - Introduced a new E2E testing guide (CLAUDE.md) outlining project structure, commands, naming conventions, and best practices for Playwright tests. - Updated relationship fixture to improve API helper signatures for better type safety and clarity. - Enhanced the NewEditContentFormPage to ensure proper loading and interaction with Dojo iframe elements. - Added multiple new test cases for relationship fields, covering scenarios such as multiple relationships, editing existing content, and verifying persistence. - Implemented helper classes for better encapsulation of relationship field interactions. These changes aim to improve the overall testing framework, ensuring robust coverage and reliability in the new edit content experience.
… in relationship tests - Added error handling for failed API responses in fireContentletWithRelationship, logging detailed error messages for better debugging. - Updated the save method in NewEditContentFormPage to use a more flexible locator for the primary action button, accommodating both Save and Publish actions. - Refined relationship field tests to improve clarity and maintainability, including renaming test cases for better readability. These changes aim to enhance the reliability and clarity of end-to-end tests for relationship fields and content creation workflows.
… improve readability - Renamed test suites and cases for clarity, focusing on "Add More Relations" and "Remove Relations". - Removed unnecessary comments and consolidated setup logic for better maintainability. - Updated test descriptions to be more concise and consistent. - Enhanced the use of helper classes for dialog interactions, improving code readability. These changes aim to improve the organization and clarity of end-to-end tests for relationship fields, ensuring a more efficient testing process.
…functionality - Introduced a new utility function `createFieldVariable` for creating field variables in content types, improving the flexibility of field management. - Updated the `TestContentType` interface to include a `fields` property for better structure and data handling. - Modified the relationship fixture to utilize the new field variable functionality, enhancing the test setup for relationship fields. - Adjusted the relationship field tests to incorporate the new field variable logic, improving test coverage and reliability. These changes aim to streamline the management of field variables in relationship tests, ensuring a more robust and flexible testing framework.
…al management - Added a new `.gitignore` file to exclude authentication state files from version control. - Introduced an `auth.setup.ts` file to handle admin authentication setup for Playwright tests, improving test efficiency by saving authentication state. - Updated `playwright.config.ts` to include a new project for setup and adjusted the Chromium project to use the saved authentication state. - Refactored credential imports across various request files to utilize a centralized `credentials.ts` file, enhancing maintainability and clarity. These changes aim to improve the structure and efficiency of end-to-end tests by centralizing authentication logic and managing credentials more effectively.
…entication handling - Modified `.gitignore` to exclude the `.auth` directory for better version control. - Updated `playwright.config.ts` to use a dynamic path for the authentication state file, enhancing portability. - Refactored `auth.setup.ts` to utilize centralized credential management, improving test setup efficiency. - Adjusted relationship field tests to streamline cleanup logic and remove unnecessary reloads, enhancing test performance and reliability. These changes aim to improve the structure and efficiency of end-to-end tests, particularly in the context of authentication and relationship field management.
- Reorganized imports in `relationship.fixture.ts` for better clarity and consistency. - Simplified function definitions and error logging in various test files to enhance readability. - Adjusted locator strategies in `newEditContentForm.page.ts` and other test files for improved maintainability. - Enhanced HTML structure in `dot-relationship-field.component.html` for better formatting. These changes aim to improve the overall structure and readability of the end-to-end tests, facilitating easier maintenance and understanding of the test framework.
8a03100 to
4289b51
Compare
…tor strategies - Updated `auth.setup.ts` to include response status checks for better error handling during authentication. - Modified `relationship.fixture.ts` to use `crypto.randomUUID()` for generating unique test suffixes, improving test reliability. - Refined locator strategies in `relationship-field.ts` to utilize role-based selectors, enhancing maintainability and clarity. These changes aim to improve the robustness and clarity of end-to-end tests, particularly in authentication and relationship field interactions.
…elationship field interactions
…elationship field interactions
…locator strategies
There was a problem hiding this comment.
Pull request overview
Adds a Playwright E2E suite for the new Edit Content relationship field (covering key relationship workflows) and makes a few targeted frontend changes to support/unstick those flows (dialog behavior, circular dep, bridge nesting, and test selectors).
Changes:
- Added Playwright E2E specs + helpers/fixtures for relationship field journeys (select/edit/table/advanced) and an auth
storageStatesetup project. - Updated relationship field UI to add stable
data-testidhooks and fixed a signals initialization warning + circular dependency (dynamic import). - Extended the edit-content form bridge to support nested dialog contexts via push/pop stack behavior.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/dot-select-existing-content.component.html | Adds data-testid hooks for error/empty states in the selection dialog. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/components/search/search.component.html | Adds a data-testid hook for the dialog search query input. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-select-existing-content/components/search/components/language-field/language-field.component.html | Adds a data-testid hook for the language filter control. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-relationship-field/dot-relationship-field.component.ts | Fixes signalMethod usage, documents row reorder semantics, and lazy-loads the create dialog component. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-relationship-field/dot-relationship-field.component.html | Adds data-testid hooks for add/delete/drag/pagination/empty UI. |
| core-web/libs/edit-content/src/lib/components/dot-create-content-dialog/dot-create-content-dialog.component.ts | Pushes/pops a form-bridge stack for nested dialogs and uses takeUntilDestroyed() for onClose subscription. |
| core-web/libs/edit-content-bridge/src/lib/factories/form-bridge.factory.ts | Exposes pushFormBridge()/popFormBridge() utilities wrapping AngularFormBridge stack operations. |
| core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts | Implements singleton stacking (push/pop) to allow nested bridge contexts. |
| core-web/libs/edit-content-bridge/src/index.ts | Re-exports the new bridge stack helpers. |
| core-web/apps/dotcms-ui-e2e/src/utils/portlets.ts | Adds centralized portlet URL constants for navigation. |
| core-web/apps/dotcms-ui-e2e/src/utils/iframe.ts | Adds getLegacyFrame() helper for the Dojo iframe. |
| core-web/apps/dotcms-ui-e2e/src/utils/credentials.ts | Centralizes E2E credentials and allows env overrides. |
| core-web/apps/dotcms-ui-e2e/src/tests/login/login.spec.ts | Switches login tests to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/relationship-field-table.spec.ts | Adds table-focused relationship E2Es (reorder/search/filter/pagination), including known-issue fixmes. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/relationship-field-select.spec.ts | Adds selection + inline-create E2Es across all cardinalities and dismissal behaviors. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/relationship-field-edit.spec.ts | Adds edit-mode E2Es for load/add/remove/persistence flows. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/relationship-field-advanced.spec.ts | Adds multi-field coexistence + showFields/custom columns E2Es. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/select-existing-content-dialog.ts | Adds a dialog-scoped locator helper for selection dialog interactions. |
| core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts | Adds a relationship-field locator helper for table/menu/delete/drag/pagination. |
| core-web/apps/dotcms-ui-e2e/src/requests/workflowActions.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/updateFeatureFlag.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/templates.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/sites.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/schemas.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/pages.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/requests/field-variables.ts | Adds API helper to create field variables (e.g., showFields). |
| core-web/apps/dotcms-ui-e2e/src/requests/contentlets.ts | Adds API helpers for create/relate/delete contentlets via workflow endpoints. |
| core-web/apps/dotcms-ui-e2e/src/requests/contentType.ts | Switches to shared credentials utility. |
| core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts | Adds navigation helpers through Dojo listing + improves save action handling. |
| core-web/apps/dotcms-ui-e2e/src/pages/login.page.ts | Updates login selectors to data-testid and stabilizes interaction sequence. |
| core-web/apps/dotcms-ui-e2e/src/fixtures/relationship.fixture.ts | Adds relationship test fixture providing API helpers + unique test suffix. |
| core-web/apps/dotcms-ui-e2e/src/auth.setup.ts | Adds Playwright setup project to persist admin storageState. |
| core-web/apps/dotcms-ui-e2e/playwright.config.ts | Adds setup/auth project wiring and increases global timeout. |
| core-web/apps/dotcms-ui-e2e/CLAUDE.md | Adds E2E testing conventions and patterns documentation. |
| core-web/apps/dotcms-ui-e2e/.gitignore | Ignores generated .auth/ storageState artifacts. |
Summary
Adds a full Playwright E2E test suite for the relationship field in the new Edit Content mode, covering all 4 cardinalities (1:1, 1:M, M:1, M:M), content selection, inline creation, search/filter, drag & drop reorder, and custom columns. Also fixes a circular dependency and signalMethod warning in the relationship field component.
Changes Made
Frontend (Angular)
DotEditContentDialogComponentvia dynamic import to resolve NG0919 (dot-relationship-field.component.ts:271)this.initialize(this.$inputs)tothis.initialize(this.$inputs())(dot-relationship-field.component.ts:191)closable: trueto Create New content dialog configpushFormBridge()/popFormBridge()toAngularFormBridgeso nested dialogs preserve outer form state (angular-form-bridge.ts:116-148)relationship-add-button,relationship-delete-button,relationship-drag-handle,relationship-table-pagination,relationship-language-filterE2E Tests (Playwright)
relationship-field-select.spec.ts— Select existing (single/multiple), create new inline, dialog dismissalrelationship-field-edit.spec.ts— Load, add, remove relations, persistencerelationship-field-table.spec.ts— Drag & drop reorder, search/filter, paginationrelationship-field-advanced.spec.ts— Multiple fields coexistence, custom columns (showFields)tests/edit-content/fields/relationship-field/helpers/storageState, shared across all workersInfrastructure & Conventions
CLAUDE.md— Comprehensive E2E testing guide with selectors, patterns, gotchasauth.setup.ts— Playwright setup project for shared authenticationutils/portlets.ts— Centralized portlet URL constants (Portlet.Content,Portlet.ContentTypes)utils/iframe.ts—getLegacyFrame()helper for Dojo iframe accessutils/credentials.ts— Moved credentials fromtests/login/to shared utilsrequests/field-variables.ts— API helper for creating field variables on content type fieldsgetByTestId('userNameInput')/getByTestId('password')withclick → fill → TabsequenceTechnical Details
beforeEachand clean up inafterEachgetLegacyFrame()+force: trueon menu clicks (flicker workaround)pagenotdialoglocatord61a59e1-a49c-46f2-a929-db2b4bfa88b2) required for Save button to appear0=ONE_TO_MANY, 1=MANY_TO_MANY, 2=ONE_TO_ONE, 3=MANY_TO_ONE(counterintuitive)Known Issues (marked as
test.fixme)<p-button>custom element requires.locator('button')for native disabled checkBreaking Changes
None
Testing
Related Issues
Closes #35022
Additional Notes
CLAUDE.mdanddotcms-e2eskill were updated with all conventions discovered during implementationstorageStateauth pattern replaces per-test login, significantly reducing test execution timeThis PR fixes: #35022