From 168b0f622a98f19593f89b1f75c49d3eac3edc3f Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Wed, 2 Sep 2026 10:55:06 +0200 Subject: [PATCH 1/2] test(pw-fixtures): make `clickViaDomRef` public --- playwright/fixtures/ui5-fixtures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/fixtures/ui5-fixtures.ts b/playwright/fixtures/ui5-fixtures.ts index e987ccf05fc..e57ecad835f 100644 --- a/playwright/fixtures/ui5-fixtures.ts +++ b/playwright/fixtures/ui5-fixtures.ts @@ -25,7 +25,7 @@ export class UI5WCHelpers { * * @param locator Locator of the UI5 custom element to click. */ - private async clickViaDomRef(locator: Locator): Promise { + async clickViaDomRef(locator: Locator): Promise { await locator.evaluate((element: HTMLElement) => { const host = element as HTMLElement & { getDomRef?: () => HTMLElement | null }; (host.getDomRef?.() ?? host).click(); From 2090cfe152f9741aff29a2d9afbaf07a7d90cdf6 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Wed, 2 Sep 2026 11:10:45 +0200 Subject: [PATCH 2/2] add test --- playwright/test/UI5Fixtures.gallery.tsx | 12 ++++++++++++ playwright/test/ui5-fixtures.spec.tsx | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/playwright/test/UI5Fixtures.gallery.tsx b/playwright/test/UI5Fixtures.gallery.tsx index 77baa684c1e..47cbef56c15 100644 --- a/playwright/test/UI5Fixtures.gallery.tsx +++ b/playwright/test/UI5Fixtures.gallery.tsx @@ -64,6 +64,18 @@ export const AttributeTestComp = () => { return ; }; +export const ClickViaDomRefTestComp = () => { + const [clicked, setClicked] = useState(false); + return ( + <> + + {clicked ? 'yes' : 'no'} + + ); +}; + export const SelectTestComp = () => { const [selectedValue, setSelectedValue] = useState(''); return ( diff --git a/playwright/test/ui5-fixtures.spec.tsx b/playwright/test/ui5-fixtures.spec.tsx index 1d0315dff7a..7c1a06f74ab 100644 --- a/playwright/test/ui5-fixtures.spec.tsx +++ b/playwright/test/ui5-fixtures.spec.tsx @@ -1,6 +1,14 @@ import { expect, test } from '../fixtures/gallery-fixtures.js'; test.describe('UI5 Web Components Fixtures', () => { + test('clickViaDomRef - clicks the element via its DOM ref', async ({ mount, page, ui5wc }) => { + await mount('test/UI5Fixtures/ClickViaDomRefTestComp'); + + await ui5wc.clickViaDomRef(page.getByTestId('test-button')); + + await expect(page.getByTestId('button-clicked')).toHaveText('yes'); + }); + test('typeIntoInput - types text into UI5 input', async ({ mount, page, ui5wc }) => { await mount('test/UI5Fixtures/InputTestComp');