diff --git a/packages/nocodb/tests/unit/factory/base.ts b/packages/nocodb/tests/unit/factory/base.ts index b7aaea7b02..ac5ef7b3e6 100644 --- a/packages/nocodb/tests/unit/factory/base.ts +++ b/packages/nocodb/tests/unit/factory/base.ts @@ -59,7 +59,7 @@ const defaultSharedBaseValue = { const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => { await request(app) - .post(`/api/v1/meta/bases/${base.id}/shared`) + .post(`//api/v1/db/meta/bases/${base.id}/shared`) .set('xc-auth', token) .send({ ...defaultSharedBaseValue, @@ -69,7 +69,7 @@ const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => { const createSakilaProject = async (context) => { const response = await request(context.app) - .post('/api/v1/meta/bases/') + .post('//api/v1/db/meta/bases/') .set('xc-auth', context.token) .send(sakilaProjectConfig(context)); @@ -81,7 +81,7 @@ const createProject = async ( baseArgs: ProjectArgs = defaultProjectValue, ) => { const response = await request(context.app) - .post('/api/v1/meta/bases/') + .post('//api/v1/db/meta/bases/') .set('xc-auth', context.token) .send({ ...baseArgs, diff --git a/packages/nocodb/tests/unit/factory/column.ts b/packages/nocodb/tests/unit/factory/column.ts index c41ef956ac..75ad87d6b8 100644 --- a/packages/nocodb/tests/unit/factory/column.ts +++ b/packages/nocodb/tests/unit/factory/column.ts @@ -164,7 +164,7 @@ const customColumns = function (type: string, options: any = {}) { const createColumn = async (context, table, columnAttr) => { await request(context.app) - .post(`/api/v1/meta/tables/${table.id}/columns`) + .post(`//api/v1/db/meta/tables/${table.id}/columns`) .set('xc-auth', context.token) .send({ ...columnAttr, @@ -373,7 +373,7 @@ const updateViewColumn = async ( { view, column, attr }: { column: Column; view: View; attr: any }, ) => { const res = await request(context.app) - .patch(`/api/v1/meta/views/${view.id}/columns/${column.id}`) + .patch(`//api/v1/db/meta/views/${view.id}/columns/${column.id}`) .set('xc-auth', context.token) .send({ ...attr, diff --git a/packages/nocodb/tests/unit/factory/table.ts b/packages/nocodb/tests/unit/factory/table.ts index a2b26572b7..2bf7e2c105 100644 --- a/packages/nocodb/tests/unit/factory/table.ts +++ b/packages/nocodb/tests/unit/factory/table.ts @@ -12,7 +12,7 @@ const defaultTableValue = (context) => ({ const createTable = async (context, base, args = {}) => { const defaultValue = defaultTableValue(context); const response = await request(context.app) - .post(`/api/v1/meta/bases/${base.id}/tables`) + .post(`//api/v1/db/meta/bases/${base.id}/tables`) .set('xc-auth', context.token) .send({ ...defaultValue, ...args }); diff --git a/packages/nocodb/tests/unit/factory/view.ts b/packages/nocodb/tests/unit/factory/view.ts index 4148467e5d..f64526bb22 100644 --- a/packages/nocodb/tests/unit/factory/view.ts +++ b/packages/nocodb/tests/unit/factory/view.ts @@ -31,7 +31,7 @@ const createView = async ( }; const response = await request(context.app) - .post(`/api/v1/meta/tables/${table.id}/${viewTypeStr(type)}`) + .post(`//api/v1/db/meta/tables/${table.id}/${viewTypeStr(type)}`) .set('xc-auth', context.token) .send({ title, @@ -53,7 +53,7 @@ const getView = async ( { table, name }: { table: Model; name: string }, ) => { const response = await request(context.app) - .get(`/api/v1/meta/tables/${table.id}/views`) + .get(`//api/v1/db/meta/tables/${table.id}/views`) .set('xc-auth', context.token); if (response.status !== 200) { throw new Error('List Views', response.body.message); @@ -85,7 +85,7 @@ const updateView = async ( if (filter.length) { for (let i = 0; i < filter.length; i++) { await request(context.app) - .post(`/api/v1/meta/views/${view.id}/filters`) + .post(`//api/v1/db/meta/views/${view.id}/filters`) .set('xc-auth', context.token) .send(filter[i]) .expect(200); @@ -95,7 +95,7 @@ const updateView = async ( if (sort.length) { for (let i = 0; i < sort.length; i++) { await request(context.app) - .post(`/api/v1/meta/views/${view.id}/sorts`) + .post(`//api/v1/db/meta/views/${view.id}/sorts`) .set('xc-auth', context.token) .send(sort[i]) .expect(200); @@ -113,7 +113,7 @@ const updateView = async ( ).id; // configure view to hide selected fields await request(context.app) - .patch(`/api/v1/meta/views/${view.id}/columns/${viewColumnId}`) + .patch(`//api/v1/db/meta/views/${view.id}/columns/${viewColumnId}`) .set('xc-auth', context.token) .send({ show: false }) .expect(200); diff --git a/tests/playwright/pages/Account/AppStore.ts b/tests/playwright/pages/Account/AppStore.ts index 6935ee82a3..ac72c0823a 100644 --- a/tests/playwright/pages/Account/AppStore.ts +++ b/tests/playwright/pages/Account/AppStore.ts @@ -13,7 +13,7 @@ export class AccountAppStorePage extends BasePage { await this.waitForResponse({ uiAction: () => this.rootPage.goto('/#/account/apps', { waitUntil: 'networkidle' }), httpMethodsToMatch: ['GET'], - requestUrlPathToMatch: 'api/v1/meta/plugins', + requestUrlPathToMatch: '/api/v1/db/meta/plugins', }); } diff --git a/tests/playwright/pages/Dashboard/Form/index.ts b/tests/playwright/pages/Dashboard/Form/index.ts index d01e716c2f..c288acfafb 100644 --- a/tests/playwright/pages/Dashboard/Form/index.ts +++ b/tests/playwright/pages/Dashboard/Form/index.ts @@ -164,7 +164,7 @@ export class FormPage extends BasePage { await this.formHeading.fill(param.title); await this.formSubHeading.click(); }, - requestUrlPathToMatch: 'api/v1/meta/forms', + requestUrlPathToMatch: '/api/v1/db/meta/forms', httpMethodsToMatch: ['PATCH'], }); await this.waitForResponse({ @@ -173,7 +173,7 @@ export class FormPage extends BasePage { await this.formSubHeading.fill(param.subtitle); await this.formHeading.click(); }, - requestUrlPathToMatch: 'api/v1/meta/forms', + requestUrlPathToMatch: '/api/v1/db/meta/forms', httpMethodsToMatch: ['PATCH'], }); } @@ -208,7 +208,7 @@ export class FormPage extends BasePage { const waitForResponse = async (action: () => Promise) => await this.waitForResponse({ uiAction: action, - requestUrlPathToMatch: 'api/v1/meta/form-columns', + requestUrlPathToMatch: '/api/v1/db/meta/form-columns', httpMethodsToMatch: ['PATCH'], }); @@ -272,7 +272,7 @@ export class FormPage extends BasePage { await this.afterSubmitMsg.click(); await this.afterSubmitMsg.fill(param.message); }, - requestUrlPathToMatch: 'api/v1/meta/forms', + requestUrlPathToMatch: '/api/v1/db/meta/forms', httpMethodsToMatch: ['PATCH'], }); } diff --git a/tests/playwright/pages/Dashboard/Grid/Column/index.ts b/tests/playwright/pages/Dashboard/Grid/Column/index.ts index 876e7b348d..8568596554 100644 --- a/tests/playwright/pages/Dashboard/Grid/Column/index.ts +++ b/tests/playwright/pages/Dashboard/Grid/Column/index.ts @@ -337,7 +337,7 @@ export class ColumnPageObject extends BasePage { await this.waitForResponse({ uiAction: async () => await this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(), - requestUrlPathToMatch: 'api/v1/meta/views', + requestUrlPathToMatch: '/api/v1/db/meta/views', httpMethodsToMatch: ['PATCH'], }); diff --git a/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts b/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts index 407c017d06..25491a46fe 100644 --- a/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts +++ b/tests/playwright/pages/Dashboard/Settings/Miscellaneous.ts @@ -25,7 +25,7 @@ export class MiscSettingsPage extends BasePage { async clickShowNullEmptyFilters() { await this.waitForResponse({ uiAction: () => this.get().locator('input[type="checkbox"]').last().click(), - requestUrlPathToMatch: 'api/v1/meta/bases', + requestUrlPathToMatch: '/api/v1/db/meta/bases', httpMethodsToMatch: ['PATCH'], }); } diff --git a/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts b/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts index bbd794e14f..9045788dfa 100644 --- a/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts +++ b/tests/playwright/pages/Dashboard/ShareProjectButton/index.ts @@ -108,7 +108,7 @@ export class ShareProjectButtonPage extends BasePage { await this.waitForResponse({ uiAction: () => this.rootPage.getByTestId('docs-base-share-public-toggle').click(), httpMethodsToMatch: ['PATCH'], - requestUrlPathToMatch: `/api/v1/meta/bases`, + requestUrlPathToMatch: `//api/v1/db/meta/bases`, }); } diff --git a/tests/playwright/pages/Dashboard/Sidebar/index.ts b/tests/playwright/pages/Dashboard/Sidebar/index.ts index 2bdb278453..e19ec8aad8 100644 --- a/tests/playwright/pages/Dashboard/Sidebar/index.ts +++ b/tests/playwright/pages/Dashboard/Sidebar/index.ts @@ -74,7 +74,7 @@ export class SidebarPage extends BasePage { await this.waitForResponse({ uiAction: () => this.dashboard.get().getByTestId('docs-create-proj-dlg-create-btn').click(), httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: `api/v1/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/bases/`, }); if (type === ProjectTypes.DOCUMENTATION) { @@ -121,7 +121,7 @@ export class SidebarPage extends BasePage { this.rootPage.locator('.ant-modal-content').locator('button.ant-btn.ant-btn-primary').click(); await this.waitForResponse({ httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: '/api/v1/meta/tables/', + requestUrlPathToMatch: '//api/v1/db/meta/tables/', uiAction: submitAction, responseJsonMatcher: json => json.title === title, }); diff --git a/tests/playwright/pages/Dashboard/TreeView.ts b/tests/playwright/pages/Dashboard/TreeView.ts index 7c61ca6d56..a5f7bd14e1 100644 --- a/tests/playwright/pages/Dashboard/TreeView.ts +++ b/tests/playwright/pages/Dashboard/TreeView.ts @@ -143,7 +143,7 @@ export class TreeViewPage extends BasePage { await this.waitForResponse({ uiAction: () => this.dashboard.get().locator('button:has-text("Create Table")').click(), httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: `/api/v1/meta/bases/`, + requestUrlPathToMatch: `//api/v1/db/meta/bases/`, responseJsonMatcher: json => json.title === title && json.type === 'table', }); @@ -179,7 +179,7 @@ export class TreeViewPage extends BasePage { return await this.dashboard.get().locator('button:has-text("Delete Table")').click(); }, httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: `/api/v1/meta/tables/`, + requestUrlPathToMatch: `//api/v1/db/meta/tables/`, }); await (await this.rootPage.locator('.nc-container').last().elementHandle())?.waitForElementState('stable'); @@ -253,7 +253,7 @@ export class TreeViewPage extends BasePage { await this.waitForResponse({ uiAction: async () => await this.rootPage.getByRole('button', { name: 'Confirm' }).click(), httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: `/api/v1/meta/duplicate/`, + requestUrlPathToMatch: `//api/v1/db/meta/duplicate/`, }); await this.get().locator(`[data-testid="nc-tbl-title-${title} copy"]`).waitFor(); } diff --git a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts index f3bca207bc..bfe2bd60a4 100644 --- a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts +++ b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts @@ -163,7 +163,7 @@ export class ViewSidebarPage extends BasePage { this.rootPage.locator('.ant-modal-content').locator('button:has-text("Create a View"):visible').click(); await this.waitForResponse({ httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: '/api/v1/meta/tables/', + requestUrlPathToMatch: '//api/v1/db/meta/tables/', uiAction: submitAction, }); // await this.verifyToast({ message: 'View created successfully' }); diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts b/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts index 5d3441639a..d5b6738e31 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts @@ -351,7 +351,7 @@ export class ToolbarFilterPage extends BasePage { await this.waitForResponse({ uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(), httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: '/api/v1/meta/filters/', + requestUrlPathToMatch: '//api/v1/db/meta/filters/', }); } else { await this.get().locator('.nc-filter-item-remove-btn').click(); @@ -367,7 +367,7 @@ export class ToolbarFilterPage extends BasePage { await this.waitForResponse({ uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(), httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: '/api/v1/meta/filters/', + requestUrlPathToMatch: '//api/v1/db/meta/filters/', }); } else { await this.get().locator('.nc-filter-item-remove-btn').click(); diff --git a/tests/playwright/pages/ProjectsPage/index.ts b/tests/playwright/pages/ProjectsPage/index.ts index d2037d9bd2..7b043a7c98 100644 --- a/tests/playwright/pages/ProjectsPage/index.ts +++ b/tests/playwright/pages/ProjectsPage/index.ts @@ -41,7 +41,7 @@ export class ProjectsPage extends BasePage { await this.waitForResponse({ uiAction: createProjectSubmitAction, httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: '/api/v1/meta/bases/', + requestUrlPathToMatch: '//api/v1/db/meta/bases/', }); // wait for dashboard to render @@ -89,7 +89,7 @@ export class ProjectsPage extends BasePage { await this.waitForResponse({ uiAction: dupeProjectSubmitAction, httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: 'api/v1/meta/duplicate/', + requestUrlPathToMatch: '/api/v1/db/meta/duplicate/', }); // wait for duplicate create completed and render kebab await this.get().locator(`[data-testid="p-three-dot-${name} copy"]`).waitFor(); @@ -103,7 +103,7 @@ export class ProjectsPage extends BasePage { const reloadUiAction = () => this.get().locator('[data-testid="bases-reload-button"]').click(); await this.waitForResponse({ uiAction: reloadUiAction, - requestUrlPathToMatch: '/api/v1/meta/bases', + requestUrlPathToMatch: '//api/v1/db/meta/bases', httpMethodsToMatch: ['GET'], }); } @@ -145,7 +145,7 @@ export class ProjectsPage extends BasePage { } const isRequiredResponse = - res.request().url().includes('/api/v1/meta/bases') && + res.request().url().includes('//api/v1/db/meta/bases') && ['GET'].includes(res.request().method()) && json?.title === title; @@ -180,7 +180,7 @@ export class ProjectsPage extends BasePage { await this.waitForResponse({ uiAction: deleteProjectAction, httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: '/api/v1/meta/bases/', + requestUrlPathToMatch: '//api/v1/db/meta/bases/', }); await this.get().locator('.ant-table-row', { hasText: title }).waitFor({ state: 'hidden' }); @@ -212,7 +212,7 @@ export class ProjectsPage extends BasePage { const submitAction = () => base.locator('input.nc-metadb-base-name').press('Enter'); await this.waitForResponse({ uiAction: submitAction, - requestUrlPathToMatch: 'api/v1/meta/bases/', + requestUrlPathToMatch: '/api/v1/db/meta/bases/', httpMethodsToMatch: ['PATCH'], }); } diff --git a/tests/playwright/pages/WorkspacePage/ContainerPage.ts b/tests/playwright/pages/WorkspacePage/ContainerPage.ts index 7974db69df..c126df8c5c 100644 --- a/tests/playwright/pages/WorkspacePage/ContainerPage.ts +++ b/tests/playwright/pages/WorkspacePage/ContainerPage.ts @@ -140,7 +140,7 @@ export class ContainerPage extends BasePage { await this.waitForResponse({ uiAction: () => this.rootPage.locator('.nc-metadb-base-name').press('Enter'), httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: `api/v1/meta/bases`, + requestUrlPathToMatch: `/api/v1/db/meta/bases`, }); } @@ -154,7 +154,7 @@ export class ContainerPage extends BasePage { await this.waitForResponse({ uiAction: () => row.locator('td.ant-table-cell').nth(0).locator('input').press('Enter'), httpMethodsToMatch: ['PATCH'], - requestUrlPathToMatch: `api/v1/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/bases/`, }); } @@ -185,7 +185,7 @@ export class ContainerPage extends BasePage { await this.waitForResponse({ uiAction: () => this.rootPage.locator('.ant-modal-content').locator('button:has-text("Delete")').click(), httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: `api/v1/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/bases/`, }); } diff --git a/tests/playwright/tests/db/features/swagger.spec.ts b/tests/playwright/tests/db/features/swagger.spec.ts index c3cb8e7764..499016d3bb 100644 --- a/tests/playwright/tests/db/features/swagger.spec.ts +++ b/tests/playwright/tests/db/features/swagger.spec.ts @@ -17,7 +17,7 @@ test.describe('Swagger', () => { test('Create column', async () => { // access swagger link - const link = `http://localhost:8080/api/v1/meta/bases/${context.base.id}/swagger`; + const link = `http://localhost:8080//api/v1/db/meta/bases/${context.base.id}/swagger`; await dashboard.rootPage.goto(link); const swagger = dashboard.rootPage;