Browse Source

Merge branch 'develop' into nc-fix/link-creation

pull/8381/head
Raju Udava 7 months ago
parent
commit
6e3322d143
  1. 2
      tests/playwright/pages/Dashboard/BulkUpdate/index.ts
  2. 3
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  3. 14
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  4. 4
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  5. 4
      tests/playwright/setup/index.ts
  6. 25
      tests/playwright/tests/db/columns/columnMultiSelect.spec.ts
  7. 27
      tests/playwright/tests/db/columns/columnSingleSelect.spec.ts
  8. 122
      tests/playwright/tests/db/columns/columnUserSelect.spec.ts

2
tests/playwright/pages/Dashboard/BulkUpdate/index.ts

@ -183,7 +183,7 @@ export class BulkUpdatePage extends BasePage {
uiAction: saveRowAction, uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/db/data/noco/', requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'], httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'], // responseJsonMatcher: json => json['pageInfo'],
}); });
} }

3
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -127,8 +127,11 @@ export class ExpandedFormPage extends BasePage {
await this.verifyToast({ message: `updated successfully.` }); await this.verifyToast({ message: `updated successfully.` });
await this.rootPage.locator('[data-testid="grid-load-spinner"]').waitFor({ state: 'hidden' }); await this.rootPage.locator('[data-testid="grid-load-spinner"]').waitFor({ state: 'hidden' });
// removing focus from toast // removing focus from toast
await this.rootPage.waitForTimeout(1000);
await this.rootPage.locator('.nc-modal').click(); await this.rootPage.locator('.nc-modal').click();
await this.rootPage.waitForTimeout(1000);
await this.get().locator('.nc-expanded-form-header').locator('.nc-expand-form-close-btn').click(); await this.get().locator('.nc-expanded-form-header').locator('.nc-expand-form-close-btn').click();
await this.get().waitFor({ state: 'hidden' }); await this.get().waitFor({ state: 'hidden' });
} }

14
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -321,14 +321,26 @@ export class ColumnPageObject extends BasePage {
// Date Format // Date Format
await this.get().locator('.nc-date-select').click(); await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click(); await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click();
// allow UI to update
await this.rootPage.waitForTimeout(500);
// Time Format // Time Format
await this.get().locator('.nc-time-select').click(); await this.get().locator('.nc-time-select').click();
await this.rootPage.locator('.ant-select-item').locator(`text="${timeFormat}"`).click(); await this.rootPage.locator('.ant-select-item').locator(`text="${timeFormat}"`).click();
// allow UI to update
await this.rootPage.waitForTimeout(500);
break; break;
case 'Date': case 'Date':
await this.get().locator('.nc-date-select').click(); await this.get().locator('.nc-date-select').click();
await this.rootPage.locator('.nc-date-select').pressSequentially(dateFormat); await this.rootPage.locator('.nc-date-select').pressSequentially(dateFormat, { delay: 100 });
await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click(); await this.rootPage.locator('.ant-select-item').locator(`text="${dateFormat}"`).click();
// allow UI to update
await this.rootPage.waitForTimeout(500);
break; break;
default: default:
break; break;

4
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -131,7 +131,7 @@ export class ToolbarFilterPage extends BasePage {
skipWaitingResponse = true; skipWaitingResponse = true;
const selectedField = await getTextExcludeIconText( const selectedField = await getTextExcludeIconText(
this.rootPage.locator('.nc-filter-field-select .ant-select-selection-item') this.rootPage.locator('.nc-filter-field-select .ant-select-selection-item').first()
); );
if (selectedField !== title) { if (selectedField !== title) {
await this.rootPage.locator('.nc-filter-field-select').last().click(); await this.rootPage.locator('.nc-filter-field-select').last().click();
@ -332,7 +332,7 @@ export class ToolbarFilterPage extends BasePage {
.locator(`.nc-dropdown-user-select-cell`) .locator(`.nc-dropdown-user-select-cell`)
.getByTestId('select-option-User-filter') .getByTestId('select-option-User-filter')
.getByText(v[i]) .getByText(v[i])
.click(); .click({ force: true });
} }
} }
break; break;

4
tests/playwright/setup/index.ts

@ -155,6 +155,7 @@ export interface NcContext {
workspace: WorkspaceType; workspace: WorkspaceType;
defaultProjectTitle: string; defaultProjectTitle: string;
defaultTableTitle: string; defaultTableTitle: string;
api: Api<any>;
} }
selectors.setTestIdAttribute('data-testid'); selectors.setTestIdAttribute('data-testid');
@ -344,7 +345,7 @@ async function localInit({
// get current user information // get current user information
const user = await api.auth.me(); const user = await api.auth.me();
return { data: { base, user, workspace, token }, status: 200 }; return { data: { base, user, workspace, token, api }, status: 200 };
} catch (e) { } catch (e) {
console.error(`Error resetting base: ${process.env.TEST_PARALLEL_INDEX}`, e); console.error(`Error resetting base: ${process.env.TEST_PARALLEL_INDEX}`, e);
return { data: {}, status: 500 }; return { data: {}, status: 500 };
@ -477,6 +478,7 @@ const setup = async ({
workspace, workspace,
defaultProjectTitle: 'Getting Started', defaultProjectTitle: 'Getting Started',
defaultTableTitle: 'Features', defaultTableTitle: 'Features',
api: response?.data?.api,
} as NcContext; } as NcContext;
}; };

25
tests/playwright/tests/db/columns/columnMultiSelect.spec.ts

@ -5,10 +5,18 @@ import setup, { unsetup } from '../../../setup';
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar'; import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
import { Api } from 'nocodb-sdk'; import { Api } from 'nocodb-sdk';
let api: Api<any>; let api: Api<any>;
const addRecordUsingAPI = async (context: any, tableId: string, rowAttributes: any) => {
try {
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, rowAttributes);
} catch (e) {
console.error(e);
}
};
test.describe('Multi select', () => { test.describe('Multi select', () => {
let dashboard: DashboardPage, grid: GridPage; let dashboard: DashboardPage, grid: GridPage;
let context: any; let context: any;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true }); context = await setup({ page, isEmptyProject: true });
@ -22,7 +30,13 @@ test.describe('Multi select', () => {
columnTitle: 'MultiSelect', columnTitle: 'MultiSelect',
options: ['Option 1', 'Option 2'], options: ['Option 1', 'Option 2'],
}); });
await grid.addNewRow({ index: 0, value: 'Row 0' });
api = context.api;
const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await addRecordUsingAPI(context, tableId, [{ Id: 1, Title: `Row 0` }]);
await page.reload();
}); });
test.afterEach(async () => { test.afterEach(async () => {
@ -56,7 +70,14 @@ test.describe('Multi select', () => {
multiSelect: true, multiSelect: true,
}); });
await grid.addNewRow({ index: 1, value: 'Row 1' }); await addRecordUsingAPI(context, tableId, [
{
Id: 2,
Title: `Row 1`,
},
]);
await grid.rootPage.reload();
await grid.cell.selectOption.select({ await grid.cell.selectOption.select({
index: 1, index: 1,
columnHeader: 'MultiSelect', columnHeader: 'MultiSelect',

27
tests/playwright/tests/db/columns/columnSingleSelect.spec.ts

@ -3,15 +3,19 @@ import { DashboardPage } from '../../../pages/Dashboard';
import { GridPage } from '../../../pages/Dashboard/Grid'; import { GridPage } from '../../../pages/Dashboard/Grid';
import setup, { unsetup } from '../../../setup'; import setup, { unsetup } from '../../../setup';
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar'; import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
import { Api } from 'nocodb-sdk';
test.describe('Single select', () => { test.describe('Single select', () => {
let dashboard: DashboardPage, grid: GridPage; let dashboard: DashboardPage, grid: GridPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.base); dashboard = new DashboardPage(page, context.base);
grid = dashboard.grid; grid = dashboard.grid;
api = context.api;
await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title }); await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title });
@ -20,7 +24,11 @@ test.describe('Single select', () => {
columnTitle: 'SingleSelect', columnTitle: 'SingleSelect',
options: ['Option 1', 'Option 2'], options: ['Option 1', 'Option 2'],
}); });
await grid.addNewRow({ index: 0, value: 'Row 0' });
const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [{ Id: 1, Title: `Row 0` }]);
await page.reload();
}); });
test.afterEach(async () => { test.afterEach(async () => {
@ -120,12 +128,15 @@ test.describe('Single select - filter & sort', () => {
let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage; let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page });
dashboard = new DashboardPage(page, context.base); dashboard = new DashboardPage(page, context.base);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
grid = dashboard.grid; grid = dashboard.grid;
api = context.api;
await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title }); await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title });
@ -134,10 +145,16 @@ test.describe('Single select - filter & sort', () => {
columnTitle: 'SingleSelect', columnTitle: 'SingleSelect',
options: ['foo', 'bar', 'baz'], options: ['foo', 'bar', 'baz'],
}); });
await grid.addNewRow({ index: 0, value: '1' });
await grid.addNewRow({ index: 1, value: '2' }); const tables = await api.dbTable.list(context.base.id);
await grid.addNewRow({ index: 2, value: '3' }); tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await grid.addNewRow({ index: 3, value: '4' }); await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 1, Title: '1' },
{ Id: 2, Title: '2' },
{ Id: 3, Title: '3' },
{ Id: 4, Title: '4' },
]);
await page.reload();
await grid.cell.selectOption.select({ index: 1, columnHeader: 'SingleSelect', option: 'foo', multiSelect: false }); await grid.cell.selectOption.select({ index: 1, columnHeader: 'SingleSelect', option: 'foo', multiSelect: false });
await grid.cell.selectOption.select({ index: 2, columnHeader: 'SingleSelect', option: 'bar', multiSelect: false }); await grid.cell.selectOption.select({ index: 2, columnHeader: 'SingleSelect', option: 'bar', multiSelect: false });

122
tests/playwright/tests/db/columns/columnUserSelect.spec.ts

@ -25,22 +25,15 @@ const roleDb = [
async function beforeEachInit({ page }: { page: any }) { async function beforeEachInit({ page }: { page: any }) {
let workspacePage: WorkspacePage; let workspacePage: WorkspacePage;
let collaborationPage: CollaborationPage; let collaborationPage: CollaborationPage;
let api: Api<any>;
const context: any = await setup({ page, isEmptyProject: true }); const context: any = await setup({ page, isEmptyProject: true });
const dashboard: DashboardPage = new DashboardPage(page, context.base); const dashboard: DashboardPage = new DashboardPage(page, context.base);
const api = context.api;
if (isEE()) { if (isEE()) {
workspacePage = new WorkspacePage(page); workspacePage = new WorkspacePage(page);
collaborationPage = workspacePage.collaboration; collaborationPage = workspacePage.collaboration;
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
for (let i = 0; i < roleDb.length; i++) { for (let i = 0; i < roleDb.length; i++) {
try { try {
await api.auth.signup({ await api.auth.signup({
@ -59,25 +52,36 @@ async function beforeEachInit({ page }: { page: any }) {
} }
} }
return { dashboard, context }; return { dashboard, context, api };
} }
test.describe('User single select', () => { test.describe('User single select', () => {
let dashboard: DashboardPage, grid: GridPage, topbar: TopbarPage; let dashboard: DashboardPage, grid: GridPage, topbar: TopbarPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
const initRsp = await beforeEachInit({ page: page }); const initRsp = await beforeEachInit({ page: page });
context = initRsp.context; context = initRsp.context;
dashboard = initRsp.dashboard; dashboard = initRsp.dashboard;
api = initRsp.api;
grid = dashboard.grid; grid = dashboard.grid;
topbar = dashboard.grid.topbar; topbar = dashboard.grid.topbar;
await dashboard.treeView.createTable({ title: 'Sheet1', baseTitle: context.base.title }); await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title });
await grid.column.create({ title: 'User', type: 'User' }); await grid.column.create({ title: 'User', type: 'User' });
await grid.addNewRow({ index: 0, value: 'Row 0' }); const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{
Id: 1,
Title: `Row 0`,
},
]);
await page.reload();
}); });
test.afterEach(async () => { test.afterEach(async () => {
@ -102,7 +106,14 @@ test.describe('User single select', () => {
}); });
// Add new row and verify default value is added in new cell // Add new row and verify default value is added in new cell
await grid.addNewRow({ index: 1, value: 'Row 1' }); await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{
Id: 2,
Title: `Row 1`,
},
]);
await grid.rootPage.reload();
await grid.cell.userOption.verify({ await grid.cell.userOption.verify({
index: 1, index: 1,
columnHeader: 'User', columnHeader: 'User',
@ -130,9 +141,17 @@ test.describe('User single select', () => {
}); });
test('Field operations - duplicate column, convert to SingleLineText', async () => { test('Field operations - duplicate column, convert to SingleLineText', async () => {
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 2, Title: `Row 1` },
{ Id: 3, Title: `Row 2` },
{ Id: 4, Title: `Row 3` },
{ Id: 5, Title: `Row 4` },
{ Id: 6, Title: `Row 5` },
]);
await grid.rootPage.reload();
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false });
await grid.addNewRow({ index: i + 1, value: `Row ${i + 1}` });
} }
await grid.column.duplicateColumn({ await grid.column.duplicateColumn({
@ -164,10 +183,19 @@ test.describe('User single select', () => {
multiSelect: false, multiSelect: false,
}); });
// add 5 rows
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 2, Title: `Row 1` },
{ Id: 3, Title: `Row 2` },
{ Id: 4, Title: `Row 3` },
{ Id: 5, Title: `Row 4` },
{ Id: 6, Title: `Row 5` },
]);
await grid.rootPage.reload();
// Edit, refresh and verify // Edit, refresh and verify
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false });
await grid.addNewRow({ index: i + 1, value: `Row ${i + 1}` });
} }
// refresh page // refresh page
@ -275,11 +303,14 @@ test.describe('User single select - filter, sort & GroupBy', () => {
let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage; let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
const initRsp = await beforeEachInit({ page: page }); const initRsp = await beforeEachInit({ page: page });
context = initRsp.context; context = initRsp.context;
dashboard = initRsp.dashboard; dashboard = initRsp.dashboard;
api = initRsp.api;
grid = dashboard.grid; grid = dashboard.grid;
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -287,8 +318,18 @@ test.describe('User single select - filter, sort & GroupBy', () => {
await grid.column.create({ title: 'User', type: 'User' }); await grid.column.create({ title: 'User', type: 'User' });
const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 1, Title: `0` },
{ Id: 2, Title: `1` },
{ Id: 3, Title: `2` },
{ Id: 4, Title: `3` },
{ Id: 5, Title: `4` },
]);
await page.reload();
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.addNewRow({ index: i, value: `${i}` });
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: false });
} }
}); });
@ -398,11 +439,14 @@ test.describe('User single select - filter, sort & GroupBy', () => {
test.describe('User multiple select', () => { test.describe('User multiple select', () => {
let dashboard: DashboardPage, grid: GridPage, topbar: TopbarPage; let dashboard: DashboardPage, grid: GridPage, topbar: TopbarPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
const initRsp = await beforeEachInit({ page: page }); const initRsp = await beforeEachInit({ page: page });
context = initRsp.context; context = initRsp.context;
dashboard = initRsp.dashboard; dashboard = initRsp.dashboard;
api = initRsp.api;
grid = dashboard.grid; grid = dashboard.grid;
topbar = dashboard.grid.topbar; topbar = dashboard.grid.topbar;
@ -410,6 +454,9 @@ test.describe('User multiple select', () => {
await grid.column.create({ title: 'User', type: 'User' }); await grid.column.create({ title: 'User', type: 'User' });
await grid.column.userOption.allowMultipleUser({ columnTitle: 'User', allowMultiple: true }); await grid.column.userOption.allowMultipleUser({ columnTitle: 'User', allowMultiple: true });
const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'Sheet1').id;
}); });
test.afterEach(async () => { test.afterEach(async () => {
@ -417,7 +464,8 @@ test.describe('User multiple select', () => {
}); });
test('Verify the default option count, select default value and verify', async () => { test('Verify the default option count, select default value and verify', async () => {
await grid.addNewRow({ index: 0, value: 'Row 0' }); await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [{ Id: 1, Title: `Row 0` }]);
await grid.rootPage.reload();
if (!isEE()) { if (!isEE()) {
await grid.column.userOption.verifyDefaultValueOptionCount({ columnTitle: 'User', totalCount: 5 }); await grid.column.userOption.verifyDefaultValueOptionCount({ columnTitle: 'User', totalCount: 5 });
@ -436,7 +484,9 @@ test.describe('User multiple select', () => {
}); });
// Add new row and verify default value is added in new cell // Add new row and verify default value is added in new cell
await grid.addNewRow({ index: 1, value: 'Row 1' }); await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [{ Id: 2, Title: `Row 1` }]);
await grid.rootPage.reload();
await grid.cell.userOption.verify({ await grid.cell.userOption.verify({
index: 1, index: 1,
columnHeader: 'User', columnHeader: 'User',
@ -452,10 +502,17 @@ test.describe('User multiple select', () => {
}); });
test('Field operations - duplicate column, convert to SingleLineText', async () => { test('Field operations - duplicate column, convert to SingleLineText', async () => {
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 1, Title: `Row 0` },
{ Id: 2, Title: `Row 1` },
{ Id: 3, Title: `Row 2` },
{ Id: 4, Title: `Row 3` },
{ Id: 5, Title: `Row 4` },
]);
await grid.rootPage.reload();
let counter = 1; let counter = 1;
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.addNewRow({ index: i, value: `Row ${i}` });
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: true }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: true });
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[counter], multiSelect: true }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[counter], multiSelect: true });
@ -497,11 +554,18 @@ test.describe('User multiple select', () => {
}); });
test('Cell Operation - edit, copy-paste and delete', async () => { test('Cell Operation - edit, copy-paste and delete', async () => {
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 1, Title: `Row 0` },
{ Id: 2, Title: `Row 1` },
{ Id: 3, Title: `Row 2` },
{ Id: 4, Title: `Row 3` },
{ Id: 5, Title: `Row 4` },
]);
await grid.rootPage.reload();
// Edit, refresh and verify // Edit, refresh and verify
let counter = 1; let counter = 1;
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.addNewRow({ index: i, value: `Row ${i}` });
await grid.cell.userOption.select({ await grid.cell.userOption.select({
index: i, index: i,
columnHeader: 'User', columnHeader: 'User',
@ -617,11 +681,14 @@ test.describe('User multiple select - filter, sort & GroupBy', () => {
let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage; let dashboard: DashboardPage, grid: GridPage, toolbar: ToolbarPage;
let context: any; let context: any;
let api: Api<any>;
let tableId: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
const initRsp = await beforeEachInit({ page: page }); const initRsp = await beforeEachInit({ page: page });
context = initRsp.context; context = initRsp.context;
dashboard = initRsp.dashboard; dashboard = initRsp.dashboard;
api = initRsp.api;
grid = dashboard.grid; grid = dashboard.grid;
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -630,9 +697,20 @@ test.describe('User multiple select - filter, sort & GroupBy', () => {
await grid.column.create({ title: 'User', type: 'User' }); await grid.column.create({ title: 'User', type: 'User' });
await grid.column.userOption.allowMultipleUser({ columnTitle: 'User', allowMultiple: true }); await grid.column.userOption.allowMultipleUser({ columnTitle: 'User', allowMultiple: true });
const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ Id: 1, Title: `0` },
{ Id: 2, Title: `1` },
{ Id: 3, Title: `2` },
{ Id: 4, Title: `3` },
{ Id: 5, Title: `4` },
]);
await grid.rootPage.reload();
let counter = 2; let counter = 2;
for (let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
await grid.addNewRow({ index: i, value: `${i}` });
await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: true }); await grid.cell.userOption.select({ index: i, columnHeader: 'User', option: users[i], multiSelect: true });
if (i !== 0) { if (i !== 0) {
await grid.cell.userOption.select({ await grid.cell.userOption.select({

Loading…
Cancel
Save