Browse Source

test: sync

pull/5537/head
Raju Udava 2 years ago
parent
commit
116ce656c5
  1. 11
      tests/playwright/tests/db/01-webhook.spec.ts
  2. 2
      tests/playwright/tests/db/accountLicense.spec.ts
  3. 2
      tests/playwright/tests/db/accountTokenManagement.spec.ts
  4. 5
      tests/playwright/tests/db/accountUserManagement.spec.ts
  5. 7
      tests/playwright/tests/db/accountUserSettings.spec.ts
  6. 9
      tests/playwright/tests/db/authChangePassword.spec.ts
  7. 5
      tests/playwright/tests/db/baseShare.spec.ts
  8. 49
      tests/playwright/tests/db/cellSelection.spec.ts
  9. 2
      tests/playwright/tests/db/columnAttachments.spec.ts
  10. 2
      tests/playwright/tests/db/columnBarcode.spec.ts
  11. 59
      tests/playwright/tests/db/columnCheckbox.spec.ts
  12. 2
      tests/playwright/tests/db/columnDateTime.spec.ts
  13. 2
      tests/playwright/tests/db/columnDuration.spec.ts
  14. 2
      tests/playwright/tests/db/columnFormula.spec.ts
  15. 2
      tests/playwright/tests/db/columnGeoData.spec.ts
  16. 2
      tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts
  17. 2
      tests/playwright/tests/db/columnLookupRollup.spec.ts
  18. 2
      tests/playwright/tests/db/columnMenuOperations.spec.ts
  19. 2
      tests/playwright/tests/db/columnMultiSelect.spec.ts
  20. 2
      tests/playwright/tests/db/columnQrCode.spec.ts
  21. 2
      tests/playwright/tests/db/columnRating.spec.ts
  22. 2
      tests/playwright/tests/db/columnRelationalExtendedTests.spec.ts
  23. 2
      tests/playwright/tests/db/columnSingleSelect.spec.ts
  24. 2
      tests/playwright/tests/db/erd.spec.ts
  25. 2
      tests/playwright/tests/db/expandedFormUrl.spec.ts
  26. 41
      tests/playwright/tests/db/filters.spec.ts
  27. 2
      tests/playwright/tests/db/keyboardShortcuts.spec.ts
  28. 2
      tests/playwright/tests/db/language.spec.ts
  29. 2
      tests/playwright/tests/db/metaSync.spec.ts
  30. 2
      tests/playwright/tests/db/mobileMode.spec.ts
  31. 2
      tests/playwright/tests/db/pagination.spec.ts
  32. 5
      tests/playwright/tests/db/rolesCreate.spec.ts
  33. 2
      tests/playwright/tests/db/rolesPreview.spec.ts
  34. 2
      tests/playwright/tests/db/rolesSuperUser.spec.ts
  35. 2
      tests/playwright/tests/db/tableColumnOperation.spec.ts
  36. 2
      tests/playwright/tests/db/tableOperations.spec.ts
  37. 2
      tests/playwright/tests/db/toolbarOperations.spec.ts
  38. 2
      tests/playwright/tests/db/viewForm.spec.ts
  39. 2
      tests/playwright/tests/db/viewFormShareSurvey.spec.ts
  40. 2
      tests/playwright/tests/db/viewGridShare.spec.ts
  41. 2
      tests/playwright/tests/db/viewKanban.spec.ts
  42. 2
      tests/playwright/tests/db/viewMap.spec.ts
  43. 2
      tests/playwright/tests/db/viewMenu.spec.ts
  44. 2
      tests/playwright/tests/db/views.spec.ts
  45. 14
      tests/playwright/tests/utils/general.ts

11
tests/playwright/tests/db/01-webhook.spec.ts

@ -427,8 +427,8 @@ test.describe.serial('Webhook', () => {
async function verifyBulkOperationTrigger(rsp, type) { async function verifyBulkOperationTrigger(rsp, type) {
for (let i = 0; i < rsp.length; i++) { for (let i = 0; i < rsp.length; i++) {
expect(rsp[i].type).toBe(type); expect(rsp[i].type).toBe(type);
expect(rsp[i].data.table_name).toBe('numberBased'); expect(rsp[i].data.table_name).toBe('Test');
expect(rsp[i].data.view_name).toBe('numberBased'); expect(rsp[i].data.view_name).toBe('Test');
// only for insert, rows inserted will not be returned in response. just count // only for insert, rows inserted will not be returned in response. just count
if (type === 'records.after.bulkInsert') { if (type === 'records.after.bulkInsert') {
@ -476,8 +476,8 @@ test.describe.serial('Webhook', () => {
try { try {
project = await api.project.read(context.project.id); project = await api.project.read(context.project.id);
table = await api.base.tableCreate(context.project.id, project.bases?.[0].id, { table = await api.base.tableCreate(context.project.id, project.bases?.[0].id, {
table_name: 'numberBased', table_name: 'Test',
title: 'numberBased', title: 'Test',
columns: columns, columns: columns,
}); });
} catch (e) { } catch (e) {
@ -485,7 +485,7 @@ test.describe.serial('Webhook', () => {
} }
await page.reload(); await page.reload();
await dashboard.treeView.openTable({ title: 'numberBased' }); await dashboard.treeView.openTable({ title: 'Test' });
// create after insert webhook // create after insert webhook
await webhook.create({ await webhook.create({
@ -508,7 +508,6 @@ test.describe.serial('Webhook', () => {
})); }));
await api.dbTableRow.bulkCreate('noco', context.project.id, table.id, rowAttributesForInsert); await api.dbTableRow.bulkCreate('noco', context.project.id, table.id, rowAttributesForInsert);
await page.reload(); await page.reload();
// 50 records inserted, we expect 2 webhook responses
let rsp = await getWebhookResponses({ request, count: 1 }); let rsp = await getWebhookResponses({ request, count: 1 });
await verifyBulkOperationTrigger(rsp, 'records.after.bulkInsert'); await verifyBulkOperationTrigger(rsp, 'records.after.bulkInsert');

2
tests/playwright/tests/db/accountLicense.spec.ts

@ -11,7 +11,7 @@ test.describe('Enterprise License', () => {
let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any; let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
accountPage = new AccountPage(page); accountPage = new AccountPage(page);
accountLicensePage = new AccountLicensePage(accountPage); accountLicensePage = new AccountLicensePage(accountPage);
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);

2
tests/playwright/tests/db/accountTokenManagement.spec.ts

@ -10,7 +10,7 @@ test.describe('User roles', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
accountPage = new AccountPage(page); accountPage = new AccountPage(page);
accountTokenPage = new AccountTokenPage(accountPage); accountTokenPage = new AccountTokenPage(accountPage);
}); });

5
tests/playwright/tests/db/accountUserManagement.spec.ts

@ -4,6 +4,7 @@ import { AccountUsersPage } from '../../pages/Account/Users';
import { ProjectsPage } from '../../pages/ProjectsPage'; import { ProjectsPage } from '../../pages/ProjectsPage';
import { SignupPage } from '../../pages/SignupPage'; import { SignupPage } from '../../pages/SignupPage';
import setup from '../../setup'; import setup from '../../setup';
import { getDefaultPwd } from '../utils/general';
const roleDb = [ const roleDb = [
{ email: 'creator@nocodb.com', role: 'Organization Level Creator', url: '' }, { email: 'creator@nocodb.com', role: 'Organization Level Creator', url: '' },
@ -19,7 +20,7 @@ test.describe('User roles', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
accountPage = new AccountPage(page); accountPage = new AccountPage(page);
accountUsersPage = new AccountUsersPage(accountPage); accountUsersPage = new AccountUsersPage(accountPage);
@ -68,7 +69,7 @@ test.describe('User roles', () => {
await signupPage.signUp({ await signupPage.signUp({
email: roleDb[roleIdx].email, email: roleDb[roleIdx].email,
password: 'Password123.', password: getDefaultPwd(),
}); });
await projectsPage.checkProjectCreateButton({ await projectsPage.checkProjectCreateButton({

7
tests/playwright/tests/db/accountUserSettings.spec.ts

@ -3,6 +3,7 @@ import { AccountPage } from '../../pages/Account';
import { AccountSettingsPage } from '../../pages/Account/Settings'; import { AccountSettingsPage } from '../../pages/Account/Settings';
import { SignupPage } from '../../pages/SignupPage'; import { SignupPage } from '../../pages/SignupPage';
import setup from '../../setup'; import setup from '../../setup';
import { getDefaultPwd } from '../utils/general';
test.describe('App settings', () => { test.describe('App settings', () => {
let accountSettingsPage: AccountSettingsPage; let accountSettingsPage: AccountSettingsPage;
@ -11,7 +12,7 @@ test.describe('App settings', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
accountPage = new AccountPage(page); accountPage = new AccountPage(page);
accountSettingsPage = accountPage.settings; accountSettingsPage = accountPage.settings;
}); });
@ -39,7 +40,7 @@ test.describe('App settings', () => {
await signupPage.signUp({ await signupPage.signUp({
email: 'test-user-1@nocodb.com', email: 'test-user-1@nocodb.com',
password: 'Password123.', password: getDefaultPwd(),
expectedError: 'Not allowed to signup, contact super admin.', expectedError: 'Not allowed to signup, contact super admin.',
}); });
@ -59,7 +60,7 @@ test.describe('App settings', () => {
await signupPage.signUp({ await signupPage.signUp({
email: 'test-user-1@nocodb.com', email: 'test-user-1@nocodb.com',
password: 'Password123.', password: getDefaultPwd(),
}); });
}); });
}); });

9
tests/playwright/tests/db/authChangePassword.spec.ts

@ -6,6 +6,7 @@ import { SettingsPage, SettingTab } from '../../pages/Dashboard/Settings';
import { SignupPage } from '../../pages/SignupPage'; import { SignupPage } from '../../pages/SignupPage';
import { ProjectsPage } from '../../pages/ProjectsPage'; import { ProjectsPage } from '../../pages/ProjectsPage';
import { AccountPage } from '../../pages/Account'; import { AccountPage } from '../../pages/Account';
import { getDefaultPwd } from '../utils/general';
test.describe('Auth', () => { test.describe('Auth', () => {
let context: any; let context: any;
@ -16,7 +17,7 @@ test.describe('Auth', () => {
let accountPage: AccountPage; let accountPage: AccountPage;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
signupPage = new SignupPage(page); signupPage = new SignupPage(page);
projectsPage = new ProjectsPage(page); projectsPage = new ProjectsPage(page);
@ -41,7 +42,7 @@ test.describe('Auth', () => {
await dashboard.rootPage.goto(url); await dashboard.rootPage.goto(url);
await signupPage.signUp({ await signupPage.signUp({
email: 'user-1@nocodb.com', email: 'user-1@nocodb.com',
password: 'Password123.', password: getDefaultPwd(),
}); });
await projectsPage.openPasswordChangeModal(); await projectsPage.openPasswordChangeModal();
@ -56,7 +57,7 @@ test.describe('Auth', () => {
// New pass and repeat pass mismatch // New pass and repeat pass mismatch
await accountPage.users.changePasswordPage.changePassword({ await accountPage.users.changePasswordPage.changePassword({
oldPass: 'Password123.', oldPass: getDefaultPwd(),
newPass: '123456789', newPass: '123456789',
repeatPass: '987654321', repeatPass: '987654321',
networkValidation: false, networkValidation: false,
@ -65,7 +66,7 @@ test.describe('Auth', () => {
// All good // All good
await accountPage.users.changePasswordPage.changePassword({ await accountPage.users.changePasswordPage.changePassword({
oldPass: 'Password123.', oldPass: getDefaultPwd(),
newPass: 'NewPasswordConfigured', newPass: 'NewPasswordConfigured',
repeatPass: 'NewPasswordConfigured', repeatPass: 'NewPasswordConfigured',
networkValidation: true, networkValidation: true,

5
tests/playwright/tests/db/baseShare.spec.ts

@ -4,6 +4,7 @@ import setup from '../../setup';
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar';
import { LoginPage } from '../../pages/LoginPage'; import { LoginPage } from '../../pages/LoginPage';
import { ProjectsPage } from '../../pages/ProjectsPage'; import { ProjectsPage } from '../../pages/ProjectsPage';
import { getDefaultPwd } from '../utils/general';
test.describe('Shared base', () => { test.describe('Shared base', () => {
let dashboard: DashboardPage; let dashboard: DashboardPage;
@ -47,7 +48,7 @@ test.describe('Shared base', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
projectPage = new ProjectsPage(page); projectPage = new ProjectsPage(page);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -77,7 +78,7 @@ test.describe('Shared base', () => {
await loginPage.signIn({ await loginPage.signIn({
email: 'user@nocodb.com', email: 'user@nocodb.com',
password: 'Password123.', password: getDefaultPwd(),
withoutPrefix: true, withoutPrefix: true,
}); });

49
tests/playwright/tests/db/cellSelection.spec.ts

@ -8,102 +8,91 @@ test.describe('Verify cell selection', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;
await dashboard.closeAllTabs();
}); });
test('#1 when range is selected, it has correct number of selected cells', async () => { test('Suite-1', async () => {
// #1 when range is selected, it has correct number of selected cells
await dashboard.treeView.openTable({ title: 'Customer' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'FirstName' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 2, columnHeader: 'Email' }, end: { index: 2, columnHeader: 'Email' },
}); });
expect(await grid.selectedCount()).toBe(9); expect(await grid.selectedCount()).toBe(9);
}); await dashboard.closeAllTabs();
test('#2 when copied with clipboard, it copies correct text', async () => { // #2 when copied with clipboard, it copies correct text
await dashboard.treeView.openTable({ title: 'Customer' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'FirstName' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 1, columnHeader: 'LastName' }, end: { index: 1, columnHeader: 'LastName' },
}); });
expect(await grid.copyWithKeyboard()).toBe('MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n'); expect(await grid.copyWithKeyboard()).toBe('MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n');
}); await dashboard.closeAllTabs();
test('#3 when copied with mouse, it copies correct text', async () => { // #3 when copied with mouse, it copies correct text
await dashboard.treeView.openTable({ title: 'Customer' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'FirstName' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 1, columnHeader: 'LastName' }, end: { index: 1, columnHeader: 'LastName' },
}); });
expect(await grid.copyWithMouse({ index: 0, columnHeader: 'FirstName' })).toBe( expect(await grid.copyWithMouse({ index: 0, columnHeader: 'FirstName' })).toBe(
'MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n' 'MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n'
); );
await dashboard.closeAllTabs();
}); });
// FIXME: this is edge case, better be moved to integration tests test('Suite-2', async ({ page }) => {
test('#4 when cell inside selection range is clicked, it clears previous selection', async () => { // #4 when cell inside selection range is clicked, it clears previous selection
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Country' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'Country' },
end: { index: 2, columnHeader: 'City List' }, end: { index: 2, columnHeader: 'City List' },
}); });
expect(await grid.selectedCount()).toBe(9); expect(await grid.selectedCount()).toBe(9);
await grid.cell.get({ index: 0, columnHeader: 'Country' }).click(); await grid.cell.get({ index: 0, columnHeader: 'Country' }).click();
expect(await grid.selectedCount()).toBe(1); expect(await grid.selectedCount()).toBe(1);
expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'Country' })); expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'Country' }));
}); await dashboard.closeAllTabs();
// FIXME: this is edge case, better be moved to integration tests // #5 when cell outside selection range is clicked, it clears previous selection
test('#5 when cell outside selection range is clicked, it clears previous selection', async () => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Country' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'Country' },
end: { index: 2, columnHeader: 'City List' }, end: { index: 2, columnHeader: 'City List' },
}); });
expect(await grid.selectedCount()).toBe(9); expect(await grid.selectedCount()).toBe(9);
await grid.cell.get({ index: 5, columnHeader: 'Country' }).click(); await grid.cell.get({ index: 5, columnHeader: 'Country' }).click();
expect(await grid.selectedCount()).toBe(1); expect(await grid.selectedCount()).toBe(1);
expect(await grid.cell.verifyCellActiveSelected({ index: 5, columnHeader: 'Country' })); expect(await grid.cell.verifyCellActiveSelected({ index: 5, columnHeader: 'Country' }));
}); await dashboard.closeAllTabs();
// FIXME: this is edge case, better be moved to integration tests // #6 when selection ends on locked field, it still works as expected
test('#6 when selection ends on locked field, it still works as expected', async () => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Country' });
await dashboard.grid.toolbar.fields.toggleShowSystemFields(); await dashboard.grid.toolbar.fields.toggleShowSystemFields();
await grid.selectRange({ await grid.selectRange({
start: { index: 2, columnHeader: 'City List' }, start: { index: 2, columnHeader: 'City List' },
end: { index: 0, columnHeader: 'Country' }, end: { index: 0, columnHeader: 'Country' },
}); });
expect(await grid.selectedCount()).toBe(12); expect(await grid.selectedCount()).toBe(12);
await grid.cell.get({ index: 1, columnHeader: 'Country' }).click(); await grid.cell.get({ index: 1, columnHeader: 'Country' }).click();
expect(await grid.selectedCount()).toBe(1); expect(await grid.selectedCount()).toBe(1);
expect(await grid.cell.verifyCellActiveSelected({ index: 1, columnHeader: 'Country' })); expect(await grid.cell.verifyCellActiveSelected({ index: 1, columnHeader: 'Country' }));
}); await dashboard.grid.toolbar.fields.toggleShowSystemFields();
await dashboard.closeAllTabs();
// FIXME: this is edge case, better be moved to integration tests // #7 when navigated with keyboard, only active cell is affected
test('#7 when navigated with keyboard, only active cell is affected', async ({ page }) => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Country' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'Country' },
end: { index: 2, columnHeader: 'City List' }, end: { index: 2, columnHeader: 'City List' },
}); });
await page.keyboard.press('ArrowRight'); await page.keyboard.press('ArrowRight');
expect(await grid.selectedCount()).toBe(1); expect(await grid.selectedCount()).toBe(1);
expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'LastUpdate' })); expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'LastUpdate' }));
await dashboard.closeAllTabs();
}); });
}); });

2
tests/playwright/tests/db/columnAttachments.spec.ts

@ -10,7 +10,7 @@ test.describe('Attachment column', () => {
let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any; let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
accountPage = new AccountPage(page); accountPage = new AccountPage(page);
accountLicensePage = new AccountLicensePage(accountPage); accountLicensePage = new AccountLicensePage(accountPage);

2
tests/playwright/tests/db/columnBarcode.spec.ts

@ -14,7 +14,7 @@ test.describe('Virtual Columns', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;
}); });

59
tests/playwright/tests/db/columnCheckbox.spec.ts

@ -2,6 +2,9 @@ import { test } from '@playwright/test';
import { DashboardPage } from '../../pages/Dashboard'; import { DashboardPage } from '../../pages/Dashboard';
import setup from '../../setup'; import setup from '../../setup';
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar';
import { UITypes } from 'nocodb-sdk';
import { Api } from 'nocodb-sdk';
let api: Api<any>;
test.describe('Checkbox - cell, filter, sort', () => { test.describe('Checkbox - cell, filter, sort', () => {
let dashboard: DashboardPage, toolbar: ToolbarPage; let dashboard: DashboardPage, toolbar: ToolbarPage;
@ -37,23 +40,61 @@ test.describe('Checkbox - cell, filter, sort', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
const columns = [
{
column_name: 'Id',
title: 'Id',
uidt: UITypes.ID,
},
{
column_name: 'Title',
title: 'Title',
uidt: UITypes.SingleLineText,
},
];
try {
const project = await api.project.read(context.project.id);
const table = await api.base.tableCreate(context.project.id, project.bases?.[0].id, {
table_name: 'Sheet-1',
title: 'Sheet-1',
columns: columns,
});
const rowAttributes = [];
for (let i = 0; i < 6; i++) {
const row = {
Id: i + 1,
Title: `1${String.fromCharCode(97 + i)}`,
};
rowAttributes.push(row);
}
await api.dbTableRow.bulkCreate('noco', context.project.id, table.id, rowAttributes);
} catch (e) {
console.error(e);
}
// page reload
await page.reload();
}); });
test('Checkbox', async () => { test('Checkbox', async () => {
// close 'Team & Auth' tab // close 'Team & Auth' tab
await dashboard.closeTab({ title: 'Team & Auth' }); await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.treeView.createTable({ title: 'Sheet1' }); await dashboard.treeView.openTable({ title: 'Sheet-1' });
await dashboard.grid.addNewRow({ index: 0, value: '1a' });
await dashboard.grid.addNewRow({ index: 1, value: '1b' });
await dashboard.grid.addNewRow({ index: 2, value: '1c' });
await dashboard.grid.addNewRow({ index: 3, value: '1d' });
await dashboard.grid.addNewRow({ index: 4, value: '1e' });
await dashboard.grid.addNewRow({ index: 5, value: '1f' });
// Create Checkbox column // Create Checkbox column
await dashboard.grid.column.create({ await dashboard.grid.column.create({

2
tests/playwright/tests/db/columnDateTime.spec.ts

@ -61,7 +61,7 @@ test.describe('DateTime Column', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnDuration.spec.ts

@ -45,7 +45,7 @@ test.describe.skip('Duration column', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnFormula.spec.ts

@ -141,7 +141,7 @@ test.describe('Virtual Columns', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnGeoData.spec.ts

@ -9,7 +9,7 @@ test.describe('Geo Data column', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;
}); });

2
tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts

@ -10,7 +10,7 @@ test.describe('LTAR create & update', () => {
test.setTimeout(150000); test.setTimeout(150000);
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnLookupRollup.spec.ts

@ -7,7 +7,7 @@ test.describe('Virtual columns', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnMenuOperations.spec.ts

@ -43,7 +43,7 @@ test.describe('Column menu operations', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnMultiSelect.spec.ts

@ -9,7 +9,7 @@ test.describe('Multi select', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;

2
tests/playwright/tests/db/columnQrCode.spec.ts

@ -14,7 +14,7 @@ test.describe('Virtual Columns', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;
}); });

2
tests/playwright/tests/db/columnRating.spec.ts

@ -37,7 +37,7 @@ test.describe('Rating - cell, filter, sort', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
}); });

2
tests/playwright/tests/db/columnRelationalExtendedTests.spec.ts

@ -8,7 +8,7 @@ test.describe('Relational Columns', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/columnSingleSelect.spec.ts

@ -9,7 +9,7 @@ test.describe('Single select', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;

2
tests/playwright/tests/db/erd.spec.ts

@ -21,7 +21,7 @@ test.describe('Erd', () => {
test.slow(); test.slow();
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
if (isPg(context)) { if (isPg(context)) {

2
tests/playwright/tests/db/expandedFormUrl.spec.ts

@ -10,7 +10,7 @@ test.describe('Expanded form URL', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

41
tests/playwright/tests/db/filters.spec.ts

@ -89,7 +89,6 @@ async function verifyFilter(param: {
return; return;
} }
await toolbar.clickFilter();
await toolbar.filter.add({ await toolbar.filter.add({
title: param.column, title: param.column,
operation: param.opType, operation: param.opType,
@ -97,16 +96,13 @@ async function verifyFilter(param: {
value: param.value, value: param.value,
locallySaved: false, locallySaved: false,
dataType: param?.dataType, dataType: param?.dataType,
openModal: true,
}); });
await toolbar.clickFilter();
// verify filtered rows // verify filtered rows
await validateRowArray({ await validateRowArray({
rowCount: param.result.rowCount, rowCount: param.result.rowCount,
}); });
// Reset filter
await toolbar.filter.reset();
} }
// Number based filters // Number based filters
@ -206,6 +202,8 @@ test.describe('Filter Tests: Numerical', () => {
}, },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: dataType, column: dataType,
@ -218,7 +216,7 @@ test.describe('Filter Tests: Numerical', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -305,6 +303,8 @@ test.describe('Filter Tests: Numerical', () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
await page.reload();
}); });
test('Filter: Number', async () => { test('Filter: Number', async () => {
@ -405,6 +405,8 @@ test.describe('Filter Tests: Text based', () => {
}, },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: dataType, column: dataType,
@ -416,7 +418,7 @@ test.describe('Filter Tests: Text based', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -485,6 +487,7 @@ test.describe('Filter Tests: Text based', () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
await page.reload();
}); });
test('Filter: Single Line Text', async () => { test('Filter: Single Line Text', async () => {
@ -577,6 +580,8 @@ test.describe('Filter Tests: Select based', () => {
}, },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: dataType, column: dataType,
@ -587,8 +592,9 @@ test.describe('Filter Tests: Select based', () => {
}); });
} }
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -641,6 +647,7 @@ test.describe('Filter Tests: Select based', () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
await page.reload();
}); });
test('Filter: Single Select', async () => { test('Filter: Single Select', async () => {
@ -933,7 +940,7 @@ test.describe('Filter Tests: Date based', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -978,6 +985,7 @@ test.describe('Filter Tests: Date based', () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
await page.reload();
}); });
test('Date : filters-1', async () => { test('Date : filters-1', async () => {
@ -1018,6 +1026,8 @@ test.describe('Filter Tests: AddOn', () => {
}, },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: dataType, column: dataType,
@ -1029,7 +1039,7 @@ test.describe('Filter Tests: AddOn', () => {
} }
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -1080,6 +1090,7 @@ test.describe('Filter Tests: AddOn', () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
await page.reload();
}); });
test('Filter: Checkbox', async () => { test('Filter: Checkbox', async () => {
@ -1108,6 +1119,8 @@ test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
{ op: 'is not blank', value: null, rowCount: 109 }, { op: 'is not blank', value: null, rowCount: 109 },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: 'City List', column: 'City List',
@ -1144,6 +1157,8 @@ test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
{ op: 'is not blank', value: null, rowCount: 599 }, { op: 'is not blank', value: null, rowCount: 599 },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: 'Lookup', column: 'Lookup',
@ -1181,6 +1196,8 @@ test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
{ op: 'is not blank', value: null, rowCount: 598 }, { op: 'is not blank', value: null, rowCount: 598 },
]; ];
await toolbar.clickFilter();
await toolbar.filter.clickAddFilter();
for (let i = 0; i < filterList.length; i++) { for (let i = 0; i < filterList.length; i++) {
await verifyFilter({ await verifyFilter({
column: 'Lookup', column: 'Lookup',
@ -1193,7 +1210,7 @@ test.describe('Filter Tests: Link to another record, Lookup, Rollup', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
@ -1237,7 +1254,7 @@ test.describe('Filter Tests: Toggle button', () => {
*/ */
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
}); });

2
tests/playwright/tests/db/keyboardShortcuts.spec.ts

@ -11,7 +11,7 @@ test.describe('Verify shortcuts', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;
}); });

2
tests/playwright/tests/db/language.spec.ts

@ -47,7 +47,7 @@ test.describe('Common', () => {
let projectsPage: ProjectsPage; let projectsPage: ProjectsPage;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
projectsPage = new ProjectsPage(page); projectsPage = new ProjectsPage(page);
}); });

2
tests/playwright/tests/db/metaSync.spec.ts

@ -11,7 +11,7 @@ test.describe('Meta sync', () => {
let dbExec; let dbExec;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
settings = dashboard.settings; settings = dashboard.settings;

2
tests/playwright/tests/db/mobileMode.spec.ts

@ -11,7 +11,7 @@ test.describe('Mobile Mode', () => {
let form: FormPage; let form: FormPage;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
form = dashboard.form; form = dashboard.form;
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;

2
tests/playwright/tests/db/pagination.spec.ts

@ -7,7 +7,7 @@ test.describe('Grid pagination', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

5
tests/playwright/tests/db/rolesCreate.spec.ts

@ -4,6 +4,7 @@ import setup from '../../setup';
import { SettingsPage, SettingTab } from '../../pages/Dashboard/Settings'; import { SettingsPage, SettingTab } from '../../pages/Dashboard/Settings';
import { SignupPage } from '../../pages/SignupPage'; import { SignupPage } from '../../pages/SignupPage';
import { ProjectsPage } from '../../pages/ProjectsPage'; import { ProjectsPage } from '../../pages/ProjectsPage';
import { getDefaultPwd } from '../utils/general';
const roleDb = [ const roleDb = [
{ email: 'creator@nocodb.com', role: 'creator', url: '' }, { email: 'creator@nocodb.com', role: 'creator', url: '' },
@ -20,7 +21,7 @@ test.describe('User roles', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
settings = dashboard.settings; settings = dashboard.settings;
signupPage = new SignupPage(page); signupPage = new SignupPage(page);
@ -110,7 +111,7 @@ test.describe('User roles', () => {
await dashboard.rootPage.goto(roleDb[roleIdx].url); await dashboard.rootPage.goto(roleDb[roleIdx].url);
await signupPage.signUp({ await signupPage.signUp({
email: roleDb[roleIdx].email, email: roleDb[roleIdx].email,
password: 'Password123.', password: getDefaultPwd(),
}); });
await projectsPage.openProject({ await projectsPage.openProject({

2
tests/playwright/tests/db/rolesPreview.spec.ts

@ -16,7 +16,7 @@ test.describe('Preview Mode', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
settings = dashboard.settings; settings = dashboard.settings;

2
tests/playwright/tests/db/rolesSuperUser.spec.ts

@ -7,7 +7,7 @@ test.describe('Super user', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/tableColumnOperation.spec.ts

@ -8,7 +8,7 @@ test.describe('Table Column Operations', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
grid = dashboard.grid; grid = dashboard.grid;

2
tests/playwright/tests/db/tableOperations.spec.ts

@ -8,7 +8,7 @@ test.describe('Table Operations', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
settings = dashboard.settings; settings = dashboard.settings;
}); });

2
tests/playwright/tests/db/toolbarOperations.spec.ts

@ -16,7 +16,7 @@ test.describe('Toolbar operations (GRID)', () => {
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
}); });

2
tests/playwright/tests/db/viewForm.spec.ts

@ -15,7 +15,7 @@ test.describe('Form view', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
form = dashboard.form; form = dashboard.form;
accountPage = new AccountPage(page); accountPage = new AccountPage(page);

2
tests/playwright/tests/db/viewFormShareSurvey.spec.ts

@ -9,7 +9,7 @@ test.describe('Share form', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/viewGridShare.spec.ts

@ -10,7 +10,7 @@ test.describe('Shared view', () => {
let sharedLink: string; let sharedLink: string;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/viewKanban.spec.ts

@ -12,7 +12,7 @@ test.describe('View', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = toolbar = dashboard.kanban.toolbar; toolbar = toolbar = dashboard.kanban.toolbar;

2
tests/playwright/tests/db/viewMap.spec.ts

@ -15,7 +15,7 @@ test.describe('Map View', () => {
const longitudeInShortDecimalLength = '30.5234'; const longitudeInShortDecimalLength = '30.5234';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.map.toolbar; toolbar = dashboard.map.toolbar;

2
tests/playwright/tests/db/viewMenu.spec.ts

@ -8,7 +8,7 @@ test.describe('Grid view locked', () => {
let context: any; let context: any;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
}); });

2
tests/playwright/tests/db/views.spec.ts

@ -9,7 +9,7 @@ test.describe('Views CRUD Operations', () => {
let toolbar: ToolbarPage; let toolbar: ToolbarPage;
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
context = await setup({ page }); context = await setup({ page, isEmptyProject: false });
dashboard = new DashboardPage(page, context.project); dashboard = new DashboardPage(page, context.project);
toolbar = dashboard.grid.toolbar; toolbar = dashboard.grid.toolbar;
}); });

14
tests/playwright/tests/utils/general.ts

@ -19,6 +19,14 @@ async function getTextExcludeIconText(selector) {
return text.trim(); return text.trim();
} }
async function getIconText(selector) {
// List of icons
const icons = await selector.locator('.material-symbols-outlined');
await icons.nth(0).waitFor();
return await icons.nth(0).textContent();
}
function isSubset(obj, potentialSubset) { function isSubset(obj, potentialSubset) {
for (const prop in potentialSubset) { for (const prop in potentialSubset) {
// eslint-disable-next-line no-prototype-builtins // eslint-disable-next-line no-prototype-builtins
@ -38,4 +46,8 @@ function isSubset(obj, potentialSubset) {
return true; return true;
} }
export { getTextExcludeIconText, isSubset }; function getDefaultPwd() {
return 'Password123.';
}
export { getTextExcludeIconText, isSubset, getIconText, getDefaultPwd };

Loading…
Cancel
Save