test(e2e): calendar page object picks a worker, not a team, in the assignee select - #8082
Merged
Merged
Conversation
…signee select eform-backendconfiguration-plugin#1295 merges teams (worker tags) into the #calendarEventAssignee select as a grouped list: a "Teams" group first, then "Medarbejdere". createWeeklyEvent picked the first `.ng-option`, which after #1295 would be a team. The new pickAssigneeWorker walks the flat ng-select option list in document order and considers only options after the last group header (`.ng-optgroup`). Workers are always the last group, and the Teams group is omitted when the property has no teams. It matches on structure, not header text, because the header is translated (da: "Hold"). It clicks the first enabled worker by its id. createWeeklyEvent also takes an optional workerName to pick a worker by exact label. Without groups (the current plugin) it still picks the first option, as before. This lands before #1295 because plugin CI checks out eform-angular-frontend stable, and shared Page objects are not synced by devgetchanges.sh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new assignee-picking logic can return null when no matching/enabled worker exists and then attempts to click id="null", which should be handled explicitly for clearer and more reliable test failures.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR updates the Playwright E2E backend-configuration calendar page object so that calendar event creation selects a worker assignee even after backend changes that introduce grouped options (Teams first, Workers last) in #calendarEventAssignee.
Changes:
- Added a dedicated
pickAssigneeWorker(workerName?)helper that selects from options after the last.ng-optgroupheader to avoid choosing a team. - Extended
createWeeklyEvent(...)to accept an optionalworkerNamefor exact-label worker selection. - Updated the weekly event creation flow to use
pickAssigneeWorkerinstead of blindly picking the first option.
File summaries
| File | Description |
|---|---|
| eform-client/playwright/e2e/Page objects/BackendConfigurationCalendar.page.ts | Ensures assignee selection picks a worker (optionally by exact name) when the assignee dropdown contains grouped team/worker options. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+112
to
+115
| ); | ||
| const optionId = (await handle.jsonValue()) as string; | ||
| await this.page.locator(`ng-dropdown-panel [id="${optionId}"]`).click(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite for microting/eform-backendconfiguration-plugin#1295 (part of epic microting/eform-backendconfiguration-plugin#1304).
#1295 merges teams (worker tags) into the task modal's
#calendarEventAssigneeselect as grouped options: a Teams group first (omitted when the property has no teams), then the workers group.BackendConfigurationCalendar.page.tspicked the first option, which after #1295 would be a team.pickAssigneeWorker(workerName?): considers only options after the last.ng-optgroupheader (workers); with no groups (today's plugin), every option is considered, so the current behaviour is unchanged.Teamsas "Hold".createWeeklyEventtakes an optionalworkerNamefor an exact-label pick.This must land before the plugin PR, because shared
Page objects/are not synced bydevgetchanges.shand plugin CI checks out frontendstable.🤖 Generated with Claude Code