Browse Source

test: waitFor license page render

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5977/head
Raju Udava 1 year ago
parent
commit
0487c96565
  1. 1
      tests/playwright/pages/Account/License.ts
  2. 175
      tests/playwright/tests/db/bulkUpdate.spec.ts

1
tests/playwright/pages/Account/License.ts

@ -28,6 +28,7 @@ export class AccountLicensePage extends BasePage {
}
async saveLicenseKey(licenseKey: string) {
await this.get().waitFor({ state: 'visible' });
await this.get().fill(licenseKey);
await this.getSaveButton().click();
await this.verifyToast({ message: 'License key updated' });

175
tests/playwright/tests/db/bulkUpdate.spec.ts

@ -8,6 +8,11 @@ import { AccountLicensePage } from '../../pages/Account/License';
import { AccountPage } from '../../pages/Account';
let bulkUpdateForm: BulkUpdatePage;
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
async function updateBulkFields(fields) {
// move all fields to active
for (let i = 0; i < fields.length; i++) {
@ -23,37 +28,35 @@ async function updateBulkFields(fields) {
await bulkUpdateForm.save({ awaitResponse: true });
}
test.describe('Bulk update', () => {
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
async function beforeEachInit({ page, tableType }: { page: any; tableType: string }) {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
table = await createDemoTable({ context, type: tableType, recordCnt: 50 });
table = await createDemoTable({ context, type: 'textBased', recordCnt: 50 });
await page.reload();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await dashboard.treeView.openTable({ title: tableType });
await dashboard.treeView.openTable({ title: 'textBased' });
// Open bulk update form
await dashboard.grid.updateAll();
}
// Open bulk update form
await dashboard.grid.updateAll();
test.describe('Bulk update', () => {
test.beforeEach(async ({ page }) => {
await beforeEachInit({ page, tableType: 'textBased' });
});
test('General- Click to add & remove', async () => {
@ -126,36 +129,8 @@ test.describe('Bulk update', () => {
});
test.describe('Bulk update', () => {
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
table = await createDemoTable({ context, type: 'numberBased', recordCnt: 50 });
await page.reload();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await dashboard.treeView.openTable({ title: 'numberBased' });
// Open bulk update form
await dashboard.grid.updateAll();
await beforeEachInit({ page, tableType: 'numberBased' });
});
test('Number based', async () => {
@ -202,36 +177,8 @@ test.describe('Bulk update', () => {
});
test.describe('Bulk update', () => {
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
table = await createDemoTable({ context, type: 'selectBased', recordCnt: 50 });
await page.reload();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await dashboard.treeView.openTable({ title: 'selectBased' });
// Open bulk update form
await dashboard.grid.updateAll();
await beforeEachInit({ page, tableType: 'selectBased' });
});
test('Select based', async () => {
@ -271,36 +218,8 @@ test.describe('Bulk update', () => {
});
test.describe('Bulk update', () => {
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
table = await createDemoTable({ context, type: 'miscellaneous', recordCnt: 50 });
await page.reload();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await dashboard.treeView.openTable({ title: 'miscellaneous' });
// Open bulk update form
await dashboard.grid.updateAll();
await beforeEachInit({ page, tableType: 'miscellaneous' });
});
test('Miscellaneous (Checkbox, attachment)', async () => {
@ -340,36 +259,8 @@ test.describe('Bulk update', () => {
});
test.describe('Bulk update', () => {
let dashboard: DashboardPage;
let context: any;
let api: Api<any>;
let table;
test.beforeEach(async ({ page }) => {
context = await setup({ page, isEmptyProject: true });
dashboard = new DashboardPage(page, context.project);
bulkUpdateForm = dashboard.bulkUpdateForm;
const accountPage: AccountPage = new AccountPage(page);
const accountLicensePage: AccountLicensePage = new AccountLicensePage(accountPage);
api = new Api({
baseURL: `http://localhost:8080/`,
headers: {
'xc-auth': context.token,
},
});
table = await createDemoTable({ context, type: 'dateTimeBased', recordCnt: 50 });
await page.reload();
await accountLicensePage.goto();
await accountLicensePage.saveLicenseKey('1234567890');
await dashboard.goto();
await dashboard.treeView.openTable({ title: 'dateTimeBased' });
// Open bulk update form
await dashboard.grid.updateAll();
await beforeEachInit({ page, tableType: 'dateTimeBased' });
});
test('Date Time Based', async () => {

Loading…
Cancel
Save