-
Notifications
You must be signed in to change notification settings - Fork 8
[DRAFT] Playwright tests #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next-minor
Are you sure you want to change the base?
Changes from 9 commits
23d053b
21fc9c4
9400d49
04fda54
915b5aa
05e775d
ed577bf
cc34bce
5c54e97
25f4384
713ee44
ba55011
4a62ef1
569e47d
782a41a
6b3a413
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './building-block-management-test-ids'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Source: Path instructions |
||
| export * from './case-management-test-ids'; | ||
| export * from './dashboard-management-test-ids'; | ||
| export * from './components-test-ids'; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| import {expect, type Locator, type Page} from '@playwright/test'; | ||
|
|
||
| /** | ||
| * Wrapper for the Valtimo `v-overflow-menu` component (the "More" menus in | ||
| * admin detail headers and carbon-list rows). | ||
| * | ||
| * The menu content is rendered in an overlay outside the trigger, so options are | ||
| * looked up page-wide rather than inside the trigger element. Options are only | ||
| * present in the DOM while the menu is open. | ||
| */ | ||
| export class OverflowMenu { | ||
| constructor( | ||
| private readonly page: Page, | ||
| private readonly triggerTestId: string | ||
| ) {} | ||
|
|
||
| get trigger(): Locator { | ||
| return this.page.getByTestId(this.triggerTestId); | ||
| } | ||
|
|
||
| get menu(): Locator { | ||
| return this.page.getByRole('menu'); | ||
| } | ||
|
|
||
| option(optionTestId: string): Locator { | ||
| return this.page.getByTestId(optionTestId); | ||
| } | ||
|
|
||
| async open() { | ||
| await expect(this.trigger).toBeEnabled(); | ||
| await this.trigger.click(); | ||
| await expect(this.menu).toBeVisible(); | ||
| } | ||
|
|
||
| async close() { | ||
| await this.page.keyboard.press('Escape'); | ||
| await expect(this.menu).not.toBeVisible(); | ||
| } | ||
|
|
||
| /** Open the menu and click one of its options. */ | ||
| async selectOption(optionTestId: string) { | ||
| await this.open(); | ||
| const option = this.option(optionTestId); | ||
| await expect(option).toBeVisible(); | ||
| await option.click(); | ||
| } | ||
|
|
||
| /** Labels of the options currently offered, in render order. */ | ||
| async optionLabels(): Promise<string[]> { | ||
| const labels = await this.menu.getByRole('menuitem').allInnerTexts(); | ||
| return labels.map(label => label.trim()); | ||
| } | ||
| } |
There was a problem hiding this comment.
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
exporton Line 1. Add the standard EUPL header before the first export.Proposed header
As per path instructions, TypeScript files must start with the standard EUPL license header.
📝 Committable suggestion
Source: Path instructions