Skip to content

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

fix(pw): handle minisidebar hidden case

Ramesh Mane80ea630f1a4f
diff --git a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
index ef91056ef8..e9d5e5d407 100644
--- a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
+++ b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
@@ -43,7 +43,7 @@ export class LeftSidebarPage extends BasePage {
this.modal_workspace = this.rootPage.locator('.nc-dropdown-workspace-menu');
- this.miniSidebar = this.dashboard.get().getByTestId('nc-mini-sidebar');
+ this.miniSidebar = this.dashboard.get().locator('[data-testid="nc-mini-sidebar"]');
this.active_base = this.get().locator('.nc-treeview-container.nc-treeview-container-active-base');
}
@@ -57,6 +57,13 @@ export class LeftSidebarPage extends BasePage {
return 1;
}
+ /**
+ * In shared base/view minisidebar will be hidden
+ */
+ async isMiniSidebarVisible() {
+ return (await this.miniSidebar.count()) > 0;
+ }
+
async verifyBaseListOpen(open: boolean = false) {
if (!(await this.isNewSidebar())) return true;
@@ -220,7 +227,7 @@ export class LeftSidebarPage extends BasePage {
type: MiniSidebarActionType;
fallback?: () => Promise<void>;
}): Promise<boolean | void> {
- if (!(await this.isNewSidebar())) {
+ if (!(await this.isNewSidebar()) || !(await this.isMiniSidebarVisible())) {
if (fallback) {
await fallback();
}
diff --git a/tests/playwright/tests/db/features/baseShare.spec.ts b/tests/playwright/tests/db/features/baseShare.spec.ts
index 12b96b274e..10ecc5030d 100644
--- a/tests/playwright/tests/db/features/baseShare.spec.ts
+++ b/tests/playwright/tests/db/features/baseShare.spec.ts
@@ -64,7 +64,7 @@ test.describe('Shared base', () => {
test('#1', async () => {
let url = '';
// share button visible only if a table is opened
- await dashboard.treeView.openTable({ title: 'Country', baseTitle: context.base.title });
+ await dashboard.treeView.openTable({ title: 'Country' });
// if (!isEE()) {
// url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'editor', enableSharedBase: true });
//
@@ -92,7 +92,7 @@ test.describe('Shared base', () => {
// }
//
// await dashboard.treeView.openProject({ title: context.base.title, context });
- // await dashboard.treeView.openTable({ title: 'Country', baseTitle: context.base.title });
+ // await dashboard.treeView.openTable({ title: 'Country' });
// }
url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'viewer', enableSharedBase: false });