Browse Source

refactor: function name clean-up

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/4882/head
Raju Udava 2 years ago
parent
commit
d88c844824
  1. 5
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  2. 4
      tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts
  3. 12
      tests/playwright/tests/columnCheckbox.spec.ts
  4. 4
      tests/playwright/tests/metaSync.spec.ts
  5. 8
      tests/playwright/tests/toolbarOperations.spec.ts
  6. 10
      tests/playwright/tests/viewGridShare.spec.ts
  7. 16
      tests/playwright/tests/viewKanban.spec.ts

5
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -28,8 +28,7 @@ export class ToolbarFilterPage extends BasePage {
).toBeChecked(); ).toBeChecked();
} }
// Todo: Handle the case of operator does not need a value async add({
async addNew({
columnTitle, columnTitle,
opType, opType,
value, value,
@ -83,7 +82,7 @@ export class ToolbarFilterPage extends BasePage {
} }
} }
async resetFilter() { async reset() {
await this.toolbar.clickFilter(); await this.toolbar.clickFilter();
await this.waitForResponse({ await this.waitForResponse({
uiAction: this.get().locator('.nc-filter-item-remove-btn').click(), uiAction: this.get().locator('.nc-filter-item-remove-btn').click(),

4
tests/playwright/pages/Dashboard/common/Toolbar/Sort.ts

@ -21,7 +21,7 @@ export class ToolbarSortPage extends BasePage {
).toHaveText(direction); ).toHaveText(direction);
} }
async addSort({ async add({
columnTitle, columnTitle,
isAscending, isAscending,
isLocallySaved, isLocallySaved,
@ -67,7 +67,7 @@ export class ToolbarSortPage extends BasePage {
} }
// todo: remove this opening sort menu logic // todo: remove this opening sort menu logic
async resetSort() { async reset() {
// open sort menu // open sort menu
await this.toolbar.clickSort(); await this.toolbar.clickSort();

12
tests/playwright/tests/columnCheckbox.spec.ts

@ -22,7 +22,7 @@ test.describe('Checkbox - cell, filter, sort', () => {
async function verifyFilter(param: { opType: string; value?: string; result: string[] }) { async function verifyFilter(param: { opType: string; value?: string; result: string[] }) {
await toolbar.clickFilter(); await toolbar.clickFilter();
await toolbar.filter.addNew({ await toolbar.filter.add({
columnTitle: 'checkbox', columnTitle: 'checkbox',
opType: param.opType, opType: param.opType,
value: param.value, value: param.value,
@ -33,7 +33,7 @@ test.describe('Checkbox - cell, filter, sort', () => {
// verify filtered rows // verify filtered rows
await validateRowArray(param.result); await validateRowArray(param.result);
// Reset filter // Reset filter
await toolbar.filter.resetFilter(); await toolbar.filter.reset();
} }
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@ -93,7 +93,7 @@ test.describe('Checkbox - cell, filter, sort', () => {
await verifyFilter({ opType: 'is not null', result: ['1a', '1b', '1c', '1f'] }); await verifyFilter({ opType: 'is not null', result: ['1a', '1b', '1c', '1f'] });
// Sort column // Sort column
await toolbar.sort.addSort({ await toolbar.sort.add({
columnTitle: 'checkbox', columnTitle: 'checkbox',
isAscending: true, isAscending: true,
isLocallySaved: false, isLocallySaved: false,
@ -103,10 +103,10 @@ test.describe('Checkbox - cell, filter, sort', () => {
} else { } else {
await validateRowArray(['1d', '1e', '1b', '1a', '1c', '1f']); await validateRowArray(['1d', '1e', '1b', '1a', '1c', '1f']);
} }
await toolbar.sort.resetSort(); await toolbar.sort.reset();
// sort descending & validate // sort descending & validate
await toolbar.sort.addSort({ await toolbar.sort.add({
columnTitle: 'checkbox', columnTitle: 'checkbox',
isAscending: false, isAscending: false,
isLocallySaved: false, isLocallySaved: false,
@ -116,7 +116,7 @@ test.describe('Checkbox - cell, filter, sort', () => {
} else { } else {
await validateRowArray(['1a', '1c', '1f', '1b', '1d', '1e']); await validateRowArray(['1a', '1c', '1f', '1b', '1d', '1e']);
} }
await toolbar.sort.resetSort(); await toolbar.sort.reset();
// wait for 10 seconds // wait for 10 seconds
await dashboard.rootPage.waitForTimeout(10000); await dashboard.rootPage.waitForTimeout(10000);

4
tests/playwright/tests/metaSync.spec.ts

@ -255,14 +255,14 @@ test.describe('Meta sync', () => {
await dashboard.grid.toolbar.fields.click({ title: 'Col1' }); await dashboard.grid.toolbar.fields.click({ title: 'Col1' });
await dashboard.grid.toolbar.clickFields(); await dashboard.grid.toolbar.clickFields();
await dashboard.grid.toolbar.sort.addSort({ await dashboard.grid.toolbar.sort.add({
columnTitle: 'Col1', columnTitle: 'Col1',
isAscending: false, isAscending: false,
isLocallySaved: false, isLocallySaved: false,
}); });
await dashboard.grid.toolbar.clickFilter(); await dashboard.grid.toolbar.clickFilter();
await dashboard.grid.toolbar.filter.addNew({ await dashboard.grid.toolbar.filter.add({
columnTitle: 'Col1', columnTitle: 'Col1',
opType: '>=', opType: '>=',
value: '5', value: '5',

8
tests/playwright/tests/toolbarOperations.spec.ts

@ -48,16 +48,16 @@ test.describe('Toolbar operations (GRID)', () => {
await validateFirstRow('Afghanistan'); await validateFirstRow('Afghanistan');
// Sort column // Sort column
await toolbar.sort.addSort({ columnTitle: 'Country', isAscending: false, isLocallySaved: false }); await toolbar.sort.add({ columnTitle: 'Country', isAscending: false, isLocallySaved: false });
await validateFirstRow('Zambia'); await validateFirstRow('Zambia');
// reset sort // reset sort
await toolbar.sort.resetSort(); await toolbar.sort.reset();
await validateFirstRow('Afghanistan'); await validateFirstRow('Afghanistan');
// Filter column // Filter column
await toolbar.clickFilter(); await toolbar.clickFilter();
await toolbar.filter.addNew({ await toolbar.filter.add({
columnTitle: 'Country', columnTitle: 'Country',
value: 'India', value: 'India',
opType: 'is equal', opType: 'is equal',
@ -68,7 +68,7 @@ test.describe('Toolbar operations (GRID)', () => {
await validateFirstRow('India'); await validateFirstRow('India');
// Reset filter // Reset filter
await toolbar.filter.resetFilter(); await toolbar.filter.reset();
await validateFirstRow('Afghanistan'); await validateFirstRow('Afghanistan');
await dashboard.closeTab({ title: 'Country' }); await dashboard.closeTab({ title: 'Country' });

10
tests/playwright/tests/viewGridShare.spec.ts

@ -33,14 +33,14 @@ test.describe('Shared view', () => {
// hide column // hide column
await dashboard.grid.toolbar.fields.toggle({ title: 'Address2' }); await dashboard.grid.toolbar.fields.toggle({ title: 'Address2' });
// sort // sort
await dashboard.grid.toolbar.sort.addSort({ await dashboard.grid.toolbar.sort.add({
columnTitle: 'District', columnTitle: 'District',
isAscending: false, isAscending: false,
isLocallySaved: false, isLocallySaved: false,
}); });
// filter // filter
await dashboard.grid.toolbar.clickFilter(); await dashboard.grid.toolbar.clickFilter();
await dashboard.grid.toolbar.filter.addNew({ await dashboard.grid.toolbar.filter.add({
columnTitle: 'Address', columnTitle: 'Address',
value: 'Ab', value: 'Ab',
opType: 'is like', opType: 'is like',
@ -101,7 +101,7 @@ test.describe('Shared view', () => {
**/ **/
// create new sort & filter criteria in shared view // create new sort & filter criteria in shared view
await sharedPage.grid.toolbar.sort.addSort({ await sharedPage.grid.toolbar.sort.add({
columnTitle: 'Address', columnTitle: 'Address',
isAscending: true, isAscending: true,
isLocallySaved: true, isLocallySaved: true,
@ -109,7 +109,7 @@ test.describe('Shared view', () => {
if (isMysql(context)) { if (isMysql(context)) {
await sharedPage.grid.toolbar.clickFilter(); await sharedPage.grid.toolbar.clickFilter();
await sharedPage.grid.toolbar.filter.addNew({ await sharedPage.grid.toolbar.filter.add({
columnTitle: 'District', columnTitle: 'District',
value: 'Ta', value: 'Ta',
opType: 'is like', opType: 'is like',
@ -196,7 +196,7 @@ test.describe('Shared view', () => {
isVisible: true, isVisible: true,
}); });
await sharedPage2.grid.toolbar.clickFilter(); await sharedPage2.grid.toolbar.clickFilter();
await sharedPage2.grid.toolbar.filter.addNew({ await sharedPage2.grid.toolbar.filter.add({
columnTitle: 'Country', columnTitle: 'Country',
value: 'New Country', value: 'New Country',
opType: 'is like', opType: 'is like',

16
tests/playwright/tests/viewKanban.spec.ts

@ -118,7 +118,7 @@ test.describe('View', () => {
}); });
// verify sort // verify sort
await toolbar.sort.addSort({ await toolbar.sort.add({
columnTitle: 'Title', columnTitle: 'Title',
isAscending: false, isAscending: false,
isLocallySaved: false, isLocallySaved: false,
@ -133,7 +133,7 @@ test.describe('View', () => {
stackIndex: i, stackIndex: i,
order: order2[i - 1], order: order2[i - 1],
}); });
await toolbar.sort.resetSort(); await toolbar.sort.reset();
// verify card order // verify card order
const order3 = [ const order3 = [
['ACE GOLDFINGER', 'AFFAIR PREJUDICE', 'AFRICAN EGG'], ['ACE GOLDFINGER', 'AFFAIR PREJUDICE', 'AFRICAN EGG'],
@ -149,7 +149,7 @@ test.describe('View', () => {
await toolbar.clickFilter({ await toolbar.clickFilter({
networkValidation: true, networkValidation: true,
}); });
await toolbar.filter.addNew({ await toolbar.filter.add({
columnTitle: 'Title', columnTitle: 'Title',
opType: 'is like', opType: 'is like',
value: 'BA', value: 'BA',
@ -167,7 +167,7 @@ test.describe('View', () => {
stackIndex: i, stackIndex: i,
order: order4[i - 1], order: order4[i - 1],
}); });
await toolbar.filter.resetFilter(); await toolbar.filter.reset();
const order5 = [ const order5 = [
['ACE GOLDFINGER', 'AFFAIR PREJUDICE', 'AFRICAN EGG'], ['ACE GOLDFINGER', 'AFFAIR PREJUDICE', 'AFRICAN EGG'],
['ACADEMY DINOSAUR', 'AGENT TRUMAN', 'ALASKA PHANTOM'], ['ACADEMY DINOSAUR', 'AGENT TRUMAN', 'ALASKA PHANTOM'],
@ -192,14 +192,14 @@ test.describe('View', () => {
index: 1, index: 1,
}); });
await toolbar.sort.addSort({ await toolbar.sort.add({
columnTitle: 'Title', columnTitle: 'Title',
isAscending: false, isAscending: false,
isLocallySaved: false, isLocallySaved: false,
}); });
await toolbar.clickFilter(); await toolbar.clickFilter();
await toolbar.filter.addNew({ await toolbar.filter.add({
columnTitle: 'Title', columnTitle: 'Title',
opType: 'is like', opType: 'is like',
value: 'BA', value: 'BA',
@ -267,8 +267,8 @@ test.describe('View', () => {
await toolbar.fields.toggleShowSystemFields(); await toolbar.fields.toggleShowSystemFields();
await toolbar.fields.toggle({ title: 'LanguageId' }); await toolbar.fields.toggle({ title: 'LanguageId' });
await toolbar.fields.toggle({ title: 'Title' }); await toolbar.fields.toggle({ title: 'Title' });
await toolbar.sort.resetSort(); await toolbar.sort.reset();
await toolbar.filter.resetFilter(); await toolbar.filter.reset();
await kanban.addCard({ stackIndex: 6 }); await kanban.addCard({ stackIndex: 6 });
await dashboard.expandedForm.fillField({ await dashboard.expandedForm.fillField({

Loading…
Cancel
Save