π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(pw): base overview page related test update
Ramesh Mane91dd11624d21
diff --git a/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue b/packages/nc-gui/components/dashboard/TreeView/Project/Home.vueindex 3e53c2f647..e88f9b3860 100644--- a/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue+++ b/packages/nc-gui/components/dashboard/TreeView/Project/Home.vue@@ -313,6 +313,7 @@ const hasTableCreatePermission = computed(() => {'!text-brand-600 !bg-brand-50 !hover:bg-brand-50': activeProjectId === base.id && baseViewOpen,'!hover:(bg-gray-200 text-gray-700)': !(activeProjectId === base.id && baseViewOpen),}"+ data-testid="nc-sidebar-base-overview-btn"@click="openBaseHomePage"><divdiff --git a/tests/playwright/pages/Dashboard/ProjectView/TablesViewPage.ts b/tests/playwright/pages/Dashboard/ProjectView/TablesViewPage.tsindex a47032e5d8..98c869dfc4 100644--- a/tests/playwright/pages/Dashboard/ProjectView/TablesViewPage.ts+++ b/tests/playwright/pages/Dashboard/ProjectView/TablesViewPage.ts@@ -21,6 +21,8 @@ export class TablesViewPage extends BasePage {}async verifyAccess(role: string) {+ await this.baseView.openOverview();+if (role.toLowerCase() === 'creator' || role.toLowerCase() === 'owner') {await this.get().waitFor({ state: 'visible' });diff --git a/tests/playwright/pages/Dashboard/ProjectView/index.ts b/tests/playwright/pages/Dashboard/ProjectView/index.tsindex 3966180e9b..7d091bbc33 100644--- a/tests/playwright/pages/Dashboard/ProjectView/index.ts+++ b/tests/playwright/pages/Dashboard/ProjectView/index.ts@@ -16,6 +16,8 @@ export class ProjectViewPage extends BasePage {readonly settings: BaseSettingsPage;// assets++ readonly sidebar_overview_btn: Locator;readonly tab_overview: Locator;readonly tab_dataSources: Locator;readonly tab_accessSettings: Locator;@@ -34,6 +36,10 @@ export class ProjectViewPage extends BasePage {this.accessSettings = new AccessSettingsPage(this);this.settings = new BaseSettingsPage(this);+ this.sidebar_overview_btn = this.dashboard.leftSidebar+ .get()+ .locator('[data-testid="nc-sidebar-base-overview-btn"]');+this.tab_overview = this.get().locator('[data-testid="proj-view-tab__overview"]');this.tab_dataSources = this.get().locator('[data-testid="proj-view-tab__data-sources"]');this.tab_accessSettings = this.get().locator('[data-testid="proj-view-tab__access-settings"]');@@ -48,7 +54,19 @@ export class ProjectViewPage extends BasePage {return this.dashboard.get().locator('.nc-base-view-tab');}+ async openOverview() {+ await this.dashboard.leftSidebar.verifyBaseListOpen(false);++ if (await this.get().isVisible()) return;++ await this.sidebar_overview_btn.click();++ await this.get().waitFor({ state: 'visible' });+ }+async verifyAccess(role: string) {+ await this.openOverview();+await this.get().waitFor({ state: 'visible' });// provide time for tabs to appeardiff --git a/tests/playwright/pages/Dashboard/TreeView.ts b/tests/playwright/pages/Dashboard/TreeView.tsindex b6e2f6e153..48d67d0888 100644--- a/tests/playwright/pages/Dashboard/TreeView.ts+++ b/tests/playwright/pages/Dashboard/TreeView.ts@@ -377,11 +377,14 @@ export class TreeViewPage extends BasePage {await this.dashboard.leftSidebar.verifyBaseListOpen(true);await this.get().getByTestId(`nc-sidebar-base-title-${title}`).click();- await this.rootPage.waitForTimeout(1000);- // TODO: FIx why base click is not always registering- await this.get().getByTestId(`nc-sidebar-base-title-${title}`).click();+ await this.dashboard.leftSidebar.action_base.waitFor({ state: 'visible' });+await this.rootPage.waitForTimeout(1000);++ // // TODO: FIx why base click is not always registering+ // await this.get().getByTestId(`nc-sidebar-base-title-${title}`).click();+ // await this.rootPage.waitForTimeout(1000);}scopedProjectTitle({ title, context }: { title: string; context: NcContext }) {diff --git a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.tsindex 5bd917a866..078147c691 100644--- a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts+++ b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts@@ -18,6 +18,8 @@ export class LeftSidebarPage extends BasePage {readonly miniSidebar: Locator;+ readonly action_base: Locator;+constructor(dashboard: DashboardPage) {super(dashboard.rootPage);this.dashboard = dashboard;@@ -30,6 +32,8 @@ 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.action_base = this.get().locator('.nc-treeview-container.nc-treeview-container-active-base');}get() {diff --git a/tests/playwright/tests/db/features/erd.spec.ts b/tests/playwright/tests/db/features/erd.spec.tsindex 59296bb3c7..5aad65937e 100644--- a/tests/playwright/tests/db/features/erd.spec.ts+++ b/tests/playwright/tests/db/features/erd.spec.ts@@ -44,6 +44,7 @@ test.describe('Erd', () => {};const openProjectErd = async () => {+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dashboard.baseView.dataSources.openERD({ rowIndex: 0 });diff --git a/tests/playwright/tests/db/features/metaSync.spec.ts b/tests/playwright/tests/db/features/metaSync.spec.tsindex 00c5a04633..393defe1a1 100644--- a/tests/playwright/tests/db/features/metaSync.spec.ts+++ b/tests/playwright/tests/db/features/metaSync.spec.ts@@ -36,6 +36,8 @@ test.describe('Meta sync', () => {test('Meta sync', async () => {test.setTimeout(process.env.CI ? 100000 : 70000);+ await dashboard.baseView.openOverview();+await dashboard.baseView.tab_dataSources.click();await dashboard.baseView.dataSources.openMetaSync({ rowIndex: 0 });@@ -251,6 +253,8 @@ test.describe('Meta sync', () => {`INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (1,1,1,1,1), (2,2,2,2,2), (3,3,3,3,3), (4,4,4,4,4), (5,5,5,5,5), (6,6,6,6,6), (7,7,7,7,7), (8,8,8,8,8), (9,9,9,9,9);`);+ await dashboard.baseView.openOverview();+await dashboard.baseView.tab_dataSources.click();await dashboard.baseView.dataSources.openMetaSync({ rowIndex: 0 });diff --git a/tests/playwright/tests/db/general/sourceRestrictions.spec.ts b/tests/playwright/tests/db/general/sourceRestrictions.spec.tsindex 4f754ba7b4..f8f65f272f 100644--- a/tests/playwright/tests/db/general/sourceRestrictions.spec.ts+++ b/tests/playwright/tests/db/general/sourceRestrictions.spec.ts@@ -30,6 +30,7 @@ test.describe('Source Restrictions', () => {test('Readonly data source', async () => {await dashboard.treeView.openProject({ title: context.base.title, context });+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dashboard.rootPage.waitForTimeout(300);@@ -56,6 +57,7 @@ test.describe('Source Restrictions', () => {test('Readonly schema source', async () => {await dashboard.treeView.openProject({ title: context.base.title, context });+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dashboard.rootPage.waitForTimeout(300);@@ -96,6 +98,7 @@ test.describe('Source Restrictions', () => {});await dashboard.treeView.openProject({ title: context.base.title, context });+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dashboard.rootPage.waitForTimeout(300);diff --git a/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts b/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.tsindex c9c65ff408..ade7bdc818 100644--- a/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts+++ b/tests/playwright/tests/db/usersAccounts/rolesPreview.spec.ts@@ -85,6 +85,7 @@ test.describe('Preview Mode', () => {// configure ACL// configure access controlawait dashboard.treeView.openProject({ title: context.base.title, context });+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dataSources.openAcl({ dataSourceName: 'Default' });@@ -98,6 +99,7 @@ test.describe('Preview Mode', () => {await dataSources.closeDsDetailsModal();await dashboard.treeView.openProject({ title: context.base.title, context });+ await dashboard.baseView.openOverview();await dashboard.baseView.tab_dataSources.click();await dataSources.openAcl({ dataSourceName: 'Default' });