Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

test(pw): ws collaborators test update

Ramesh Manebb557a539c71
diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
index fe9ff121f0..9ee337e715 100644
--- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
+++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
@@ -492,6 +492,7 @@ defineExpose({
<div
ref="baseNodeRefs"
:class="{
+ 'nc-project-header': isProjectHeader,
'text-subHeading2 gap-2 hover:bg-nc-bg-gray-medium h-8 cursor-pointer px-1 max-w-full': isProjectHeader,
'flex-grow w-full': isProjectHeader && editMode,
'bg-nc-bg-gray-medium': isProjectHeader && isProjectNodeContextMenuOpen,
diff --git a/tests/playwright/pages/Dashboard/Sidebar/ProjectNode/index.ts b/tests/playwright/pages/Dashboard/Sidebar/ProjectNode/index.ts
index 2b951c3baf..cb23b74446 100644
--- a/tests/playwright/pages/Dashboard/Sidebar/ProjectNode/index.ts
+++ b/tests/playwright/pages/Dashboard/Sidebar/ProjectNode/index.ts
@@ -161,4 +161,38 @@ export class SidebarProjectNodeObject extends BasePage {
await this.clickOptions({ baseTitle });
}
}
+
+ async verifyActiveProject({ baseTitle, open = false }: { baseTitle: string; open?: boolean }) {
+ const isBaseListSidebar = await this.sidebar.dashboard.leftSidebar.verifyBaseListOpen(false);
+ // If base home page sidebar is open then verify base title is same as baseTitle
+ if (!isBaseListSidebar) {
+ const baseLocator = await this.get({ baseTitle }).getAttribute('class');
+
+ // If active project is same as baseTitle then return true
+ if (baseLocator?.includes('nc-project-header')) return true;
+
+ if (!open) return false;
+
+ // If it is not same base home page sidebar then go to base list and open
+ await this.sidebar.dashboard.leftSidebar.verifyBaseListOpen(true);
+ }
+
+ if (!open) return false;
+
+ await this.get({
+ baseTitle,
+ }).waitFor({ state: 'visible' });
+
+ await this.get({
+ baseTitle,
+ }).scrollIntoViewIfNeeded();
+
+ await this.get({
+ baseTitle,
+ }).click();
+
+ await this.sidebar.dashboard.leftSidebar.active_base.waitFor({ state: 'visible' });
+
+ return true;
+ }
}
diff --git a/tests/playwright/pages/Dashboard/Sidebar/TableNode/index.ts b/tests/playwright/pages/Dashboard/Sidebar/TableNode/index.ts
index e129c76a2a..cbe64b6214 100644
--- a/tests/playwright/pages/Dashboard/Sidebar/TableNode/index.ts
+++ b/tests/playwright/pages/Dashboard/Sidebar/TableNode/index.ts
@@ -15,13 +15,21 @@ export class SidebarTableNodeObject extends BasePage {
return this.sidebar.get().getByTestId(`nc-tbl-side-node-${tableTitle}`);
}
- async click({ tableTitle }: { tableTitle: string }) {
+ async click({ tableTitle, baseTitle }: { tableTitle: string; baseTitle?: string }) {
+ if (baseTitle) {
+ await this.sidebar.baseNode.verifyActiveProject({ baseTitle, open: true });
+ }
+
await this.get({
tableTitle,
}).click();
}
- async clickOptions({ tableTitle }: { tableTitle: string }) {
+ async clickOptions({ tableTitle, baseTitle }: { tableTitle: string; baseTitle?: string }) {
+ if (baseTitle) {
+ await this.sidebar.baseNode.verifyActiveProject({ baseTitle, open: true });
+ }
+
await this.get({
tableTitle,
}).hover();
@@ -40,6 +48,7 @@ export class SidebarTableNodeObject extends BasePage {
renameVisible,
duplicateVisible,
deleteVisible,
+ baseTitle,
}: {
tableTitle: string;
isVisible: boolean;
@@ -47,7 +56,12 @@ export class SidebarTableNodeObject extends BasePage {
renameVisible?: boolean;
duplicateVisible?: boolean;
deleteVisible?: boolean;
+ baseTitle?: string;
}) {
+ if (baseTitle) {
+ await this.sidebar.baseNode.verifyActiveProject({ baseTitle, open: true });
+ }
+
if (isVisible) {
await this.clickOptions({ tableTitle });
await this.rootPage.getByTestId(`sidebar-table-context-menu-list-${tableTitle}`).waitFor({ state: 'visible' });
diff --git a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
index 75bc2883f2..3047aa1c61 100644
--- a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
+++ b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
@@ -248,7 +248,6 @@ export class LeftSidebarPage extends BasePage {
for (const type of types) {
const locator = await this.getMiniSidebarActionLocator({ type });
- console.log('locator', locator);
if (isVisible) await expect(locator).toBeVisible();
else await expect(locator).not.toBeVisible();
}