mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-05 15:26:59 +00:00
Nc test/flaky fix (#8349)
* fix: flaky test * Update index.ts * fix: flaky with addNewRow- replace with APIs * fix: groupby flaky * test: retry attempt for calendar sidebar card count * test: use x button instead of escape to close expand modal * test: fix selected cell count retry * test: fix flaky for cmd K * fix: increase wait time after form submission
This commit is contained in:
@@ -3,6 +3,8 @@ import { DashboardPage } from '../../../pages/Dashboard';
|
||||
import { GridPage } from '../../../pages/Dashboard/Grid';
|
||||
import setup, { unsetup } from '../../../setup';
|
||||
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar';
|
||||
import { Api } from 'nocodb-sdk';
|
||||
let api: Api<any>;
|
||||
|
||||
test.describe('Multi select', () => {
|
||||
let dashboard: DashboardPage, grid: GridPage;
|
||||
@@ -206,6 +208,13 @@ test.describe('Multi select - filters', () => {
|
||||
toolbar = dashboard.grid.toolbar;
|
||||
grid = dashboard.grid;
|
||||
|
||||
api = new Api({
|
||||
baseURL: `http://localhost:8080/`,
|
||||
headers: {
|
||||
'xc-auth': context.token,
|
||||
},
|
||||
});
|
||||
|
||||
await dashboard.treeView.createTable({ title: 'sheet1', baseTitle: context.base.title });
|
||||
|
||||
await grid.column.create({ title: 'MultiSelect', type: 'MultiSelect' });
|
||||
@@ -213,12 +222,26 @@ test.describe('Multi select - filters', () => {
|
||||
columnTitle: 'MultiSelect',
|
||||
options: ['foo', 'bar', 'baz'],
|
||||
});
|
||||
await grid.addNewRow({ index: 0, value: '1' });
|
||||
await grid.addNewRow({ index: 1, value: '2' });
|
||||
await grid.addNewRow({ index: 2, value: '3' });
|
||||
await grid.addNewRow({ index: 3, value: '4' });
|
||||
await grid.addNewRow({ index: 4, value: '5' });
|
||||
await grid.addNewRow({ index: 5, value: '6' });
|
||||
|
||||
try {
|
||||
const tables = await api.dbTable.list(context.base.id);
|
||||
const rowAttributes = [];
|
||||
for (let i = 0; i < 6; i++) {
|
||||
const row = {
|
||||
Id: i + 1,
|
||||
Title: `${i + 1}`,
|
||||
};
|
||||
rowAttributes.push(row);
|
||||
}
|
||||
|
||||
const tableId = tables.list.find((table: any) => table.table_name === 'sheet1').id;
|
||||
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, rowAttributes);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
// page reload
|
||||
await page.reload();
|
||||
|
||||
await grid.cell.selectOption.select({ index: 1, columnHeader: 'MultiSelect', option: 'foo', multiSelect: true });
|
||||
await grid.cell.selectOption.select({ index: 2, columnHeader: 'MultiSelect', option: 'bar', multiSelect: true });
|
||||
|
||||
Reference in New Issue
Block a user