Skip to content

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

test(nc-gui): update project rename, delete test

Ramesh Mane932d7620107b
diff --git a/tests/playwright/pages/Dashboard/TreeView.ts b/tests/playwright/pages/Dashboard/TreeView.ts
index 17053b7ef6..739065d218 100644
--- a/tests/playwright/pages/Dashboard/TreeView.ts
+++ b/tests/playwright/pages/Dashboard/TreeView.ts
@@ -34,11 +34,16 @@ export class TreeViewPage extends BasePage {
private async openProjectContextMenu({ baseTitle }: { baseTitle: string }) {
await this.dashboard.get().getByTestId(`nc-sidebar-base-title-${baseTitle}`).hover();
- await this.dashboard
- .get()
- .getByTestId(`nc-sidebar-base-title-${baseTitle}`)
- .locator('[data-testid="nc-sidebar-context-menu"]')
- .click();
+ const baseTitleElement = this.dashboard.get().getByTestId(`nc-sidebar-base-title-${baseTitle}`);
+
+ if (
+ (await baseTitleElement.isVisible()) &&
+ !(await baseTitleElement.locator('[data-testid="nc-sidebar-context-menu"]').isVisible())
+ ) {
+ return await baseTitleElement.click();
+ }
+
+ await baseTitleElement.locator('[data-testid="nc-sidebar-context-menu"]').click();
}
async isVisible() {
@@ -407,6 +412,8 @@ export class TreeViewPage extends BasePage {
}
async deleteProject(param: { title: string; context: NcContext }) {
+ await this.dashboard.leftSidebar.verifyBaseListOpen(true);
+
param.title = this.scopedProjectTitle({ title: param.title, context: param.context });
await this.openProjectContextMenu({ baseTitle: param.title });
diff --git a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
index 7ad453c7c2..5bd917a866 100644
--- a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
+++ b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
@@ -55,11 +55,16 @@ export class LeftSidebarPage extends BasePage {
await this.miniSidebarActionClick({ type: 'base' });
}
+ // Wait for the sidebar list transition to complete
+ await this.rootPage.waitForTimeout(500);
+
return isListOpen;
}
async createProject({ title, context }: { title: string; context: NcContext }) {
title = isEE() ? title : `nc-${context.workerId}-${title}`;
+ await this.verifyBaseListOpen(true);
+
await this.btn_newProject.click();
if (isEE()) {
@@ -73,6 +78,11 @@ export class LeftSidebarPage extends BasePage {
.locator('.ant-modal-content:has-text(" Create Base")')
.locator('button.ant-btn-primary')
.click();
+
+ await this.rootPage.locator('.nc-sidebar-header.nc-active-project').waitFor({ state: 'visible' });
+
+ // Open base list if it's not already open
+ await this.verifyBaseListOpen(true);
}
async clickTeamAndSettings() {
diff --git a/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts b/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts
index 3b6faee147..975077d302 100644
--- a/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts
+++ b/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts
@@ -119,6 +119,8 @@ test.describe('User roles', () => {
// wait for page rendering to complete after sign up
await dashboard.rootPage.waitForTimeout(1000);
+ await dashboard.leftSidebar.verifyBaseListOpen(true);
+
if (roleDb[roleIdx].role === 'Organization Level Creator') {
await expect(dashboard.leftSidebar.btn_newProject).toBeVisible();
} else {