Browse Source

test: leave a time gap between date & time config

pull/8380/head
Raju Udava 7 months ago
parent
commit
4321c0f9ef
  1. 4
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  2. 5
      tests/playwright/tests/db/columns/columnSingleSelect.spec.ts
  3. 12
      tests/playwright/tests/db/columns/columnUserSelect.spec.ts

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

@ -321,6 +321,10 @@ 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();

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

@ -156,11 +156,6 @@ test.describe('Single select - filter & sort', () => {
]); ]);
await page.reload(); await page.reload();
// 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.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 });
await grid.cell.selectOption.select({ index: 3, columnHeader: 'SingleSelect', option: 'baz', multiSelect: false }); await grid.cell.selectOption.select({ index: 3, columnHeader: 'SingleSelect', option: 'baz', multiSelect: false });

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

@ -74,7 +74,6 @@ test.describe('User single select', () => {
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); const tables = await api.dbTable.list(context.base.id);
tableId = tables.list.find((table: any) => table.title === 'sheet1').id; tableId = tables.list.find((table: any) => table.title === 'sheet1').id;
await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [ await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
@ -108,7 +107,6 @@ 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, [ await api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [
{ {
Id: 2, Id: 2,
@ -155,7 +153,6 @@ test.describe('User single select', () => {
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({
@ -200,7 +197,6 @@ test.describe('User single select', () => {
// 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
@ -335,7 +331,6 @@ test.describe('User single select - filter, sort & GroupBy', () => {
await page.reload(); 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 });
} }
}); });
@ -470,7 +465,6 @@ 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 api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [{ Id: 1, Title: `Row 0` }]);
await grid.rootPage.reload(); await grid.rootPage.reload();
@ -491,7 +485,6 @@ 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 api.dbTableRow.bulkCreate('noco', context.base.id, tableId, [{ Id: 2, Title: `Row 1` }]);
await grid.rootPage.reload(); await grid.rootPage.reload();
@ -521,8 +514,6 @@ test.describe('User multiple select', () => {
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 });
@ -576,8 +567,6 @@ test.describe('User multiple select', () => {
// 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',
@ -723,7 +712,6 @@ test.describe('User multiple select - filter, sort & GroupBy', () => {
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