Browse Source

test: formula datetime verification, wip

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5642/head
Raju Udava 2 years ago
parent
commit
5b1f9853c1
  1. 51
      tests/playwright/tests/db/timezone.spec.ts

51
tests/playwright/tests/db/timezone.spec.ts

@ -459,7 +459,7 @@ function getDateTimeInUTCTimeZone(dateString: string) {
return `${outputString}+00:00`; return `${outputString}+00:00`;
} }
test.describe('External DB - DateTime column', async () => { test.describe.serial('External DB - DateTime column', async () => {
let dashboard: DashboardPage; let dashboard: DashboardPage;
let context: any; let context: any;
@ -561,6 +561,55 @@ test.describe('External DB - DateTime column', async () => {
await dashboard.rootPage.waitForTimeout(2000); await dashboard.rootPage.waitForTimeout(2000);
}); });
test.skip('Formula, verify display value', async () => {
try {
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
const projectList = await api.project.list();
const table = await api.dbTable.list(projectList.list[0].id);
await api.dbTableColumn.create(table.list[0].id, {
title: 'formula-1',
uidt: UITypes.Formula,
formula_raw: 'DATEADD(DatetimeWithoutTz, 1, "day")',
});
const table2 = await api.dbTableColumn.create(table.list[0].id, {
title: 'formula-2',
uidt: UITypes.Formula,
formula_raw: 'DATEADD(DatetimeWithTz, 1, "day")',
});
await api.dbTableColumn.update(table2.columns[3].id, {
title: 'formula-23',
column_name: 'formula-23',
uidt: UITypes.Formula,
formula_raw: 'DATEADD(DatetimeWithTz, 1, "month")',
});
} catch (e) {
console.log(e);
}
await dashboard.treeView.openBase({ title: 'datetimetable' });
await dashboard.treeView.openTable({ title: 'MyTable' });
// Insert new row
await dashboard.grid.cell.dateTime.setDateTime({
index: 2,
columnHeader: 'DatetimeWithoutTz',
dateTime: '2023-04-27 10:00:00',
});
await dashboard.rootPage.waitForTimeout(1000);
await dashboard.grid.cell.dateTime.setDateTime({
index: 2,
columnHeader: 'DatetimeWithTz',
dateTime: '2023-04-27 10:00:00',
});
console.log(table);
});
test('Verify display value, UI insert, API response', async () => { test('Verify display value, UI insert, API response', async () => {
// get timezone offset // get timezone offset
const timezoneOffset = new Date().getTimezoneOffset(); const timezoneOffset = new Date().getTimezoneOffset();

Loading…
Cancel
Save