From 91f80019772329b6b7da81b0e0106f5ff9051d07 Mon Sep 17 00:00:00 2001 From: Lan Nguyen Thuy Date: Tue, 7 Oct 2025 16:12:11 +0700 Subject: [PATCH 1/4] Add helper: for workspace view --- lib/helpers/ContentUiHelper.ts | 4 ++++ lib/helpers/MediaUiHelper.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/helpers/ContentUiHelper.ts b/lib/helpers/ContentUiHelper.ts index 7cd5d512..72c671f6 100644 --- a/lib/helpers/ContentUiHelper.ts +++ b/lib/helpers/ContentUiHelper.ts @@ -1714,4 +1714,8 @@ export class ContentUiHelper extends UiBaseLocators { async isContentNameReadOnly() { await expect(this.contentNameTxt).toHaveAttribute('readonly'); } + + async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { + await expect(this.documentWorkspaceEditor.locator('uui-tab[data-mark="workspace:view-link:'+alias+'"]')).toBeVisible({visible: isVisible}); + } } \ No newline at end of file diff --git a/lib/helpers/MediaUiHelper.ts b/lib/helpers/MediaUiHelper.ts index 6cad4761..73c8e354 100644 --- a/lib/helpers/MediaUiHelper.ts +++ b/lib/helpers/MediaUiHelper.ts @@ -220,4 +220,8 @@ export class MediaUiHelper extends UiBaseLocators { await expect(this.mediaTreeItem.getByText(mediaName, {exact: true})).toBeVisible(); await this.mediaTreeItem.getByText(mediaName, {exact: true}).click(); } + + async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { + await expect(this.mediaWorkspace.locator('uui-tab[data-mark="workspace:view-link:'+alias+'"]')).toBeVisible({visible: isVisible}); + } } \ No newline at end of file From 8c7e30a3531bc62c03527d0152199a6d4bb838c5 Mon Sep 17 00:00:00 2001 From: NguyenThuyLan <116753400+NguyenThuyLan@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:11:04 +0700 Subject: [PATCH 2/4] Update lib/helpers/ContentUiHelper.ts Co-authored-by: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com> --- lib/helpers/ContentUiHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers/ContentUiHelper.ts b/lib/helpers/ContentUiHelper.ts index 72c671f6..4daa329a 100644 --- a/lib/helpers/ContentUiHelper.ts +++ b/lib/helpers/ContentUiHelper.ts @@ -1716,6 +1716,6 @@ export class ContentUiHelper extends UiBaseLocators { } async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { - await expect(this.documentWorkspaceEditor.locator('uui-tab[data-mark="workspace:view-link:'+alias+'"]')).toBeVisible({visible: isVisible}); + await expect(this.documentWorkspaceEditor.getByTestId('workspace:view-link:' + alias)).toBeVisible({visible: isVisible}); } } \ No newline at end of file From 12f5b3722782ee02a20469c68e76a86ef052d9b0 Mon Sep 17 00:00:00 2001 From: Lan Nguyen Thuy Date: Mon, 13 Oct 2025 16:37:46 +0700 Subject: [PATCH 3/4] move method into UiBaseLocators --- lib/helpers/ContentUiHelper.ts | 4 ---- lib/helpers/MediaUiHelper.ts | 4 ---- lib/helpers/UiBaseLocators.ts | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/helpers/ContentUiHelper.ts b/lib/helpers/ContentUiHelper.ts index 72c671f6..7cd5d512 100644 --- a/lib/helpers/ContentUiHelper.ts +++ b/lib/helpers/ContentUiHelper.ts @@ -1714,8 +1714,4 @@ export class ContentUiHelper extends UiBaseLocators { async isContentNameReadOnly() { await expect(this.contentNameTxt).toHaveAttribute('readonly'); } - - async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { - await expect(this.documentWorkspaceEditor.locator('uui-tab[data-mark="workspace:view-link:'+alias+'"]')).toBeVisible({visible: isVisible}); - } } \ No newline at end of file diff --git a/lib/helpers/MediaUiHelper.ts b/lib/helpers/MediaUiHelper.ts index 73c8e354..6cad4761 100644 --- a/lib/helpers/MediaUiHelper.ts +++ b/lib/helpers/MediaUiHelper.ts @@ -220,8 +220,4 @@ export class MediaUiHelper extends UiBaseLocators { await expect(this.mediaTreeItem.getByText(mediaName, {exact: true})).toBeVisible(); await this.mediaTreeItem.getByText(mediaName, {exact: true}).click(); } - - async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { - await expect(this.mediaWorkspace.locator('uui-tab[data-mark="workspace:view-link:'+alias+'"]')).toBeVisible({visible: isVisible}); - } } \ No newline at end of file diff --git a/lib/helpers/UiBaseLocators.ts b/lib/helpers/UiBaseLocators.ts index bf7901e2..03e1c3a8 100644 --- a/lib/helpers/UiBaseLocators.ts +++ b/lib/helpers/UiBaseLocators.ts @@ -1408,4 +1408,8 @@ export class UiBaseLocators { await this.page.keyboard.press('Backspace'); await this.page.keyboard.insertText(value); } + + async isWorkspaceViewTabWithAliasVisible(alias: string, isVisible: boolean = true) { + await expect(this.page.getByTestId('workspace:view-link:' + alias)).toBeVisible({ visible: isVisible }); + } } From ee1cefe3bec5f71609bedd6750a22720a5371886 Mon Sep 17 00:00:00 2001 From: Lan Nguyen Thuy Date: Mon, 13 Oct 2025 16:39:14 +0700 Subject: [PATCH 4/4] update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 240da7ab..003d5262 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@umbraco/playwright-testhelpers", - "version": "16.0.53", + "version": "16.0.54", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@umbraco/playwright-testhelpers", - "version": "16.0.53", + "version": "16.0.54", "license": "MIT", "dependencies": { "@umbraco/json-models-builders": "2.0.40", diff --git a/package.json b/package.json index ceba6a60..51c4831e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@umbraco/playwright-testhelpers", - "version": "16.0.53", + "version": "16.0.54", "description": "Test helpers for making playwright tests for Umbraco solutions", "main": "dist/lib/index.js", "files": [