|
|
@ -44,6 +44,35 @@ async function validateRowArray(param) { |
|
|
|
await dashboard.grid.verifyTotalRowCount({ count: rowCount }); |
|
|
|
await dashboard.grid.verifyTotalRowCount({ count: rowCount }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function verifyFilter_withFixedModal(param: { |
|
|
|
|
|
|
|
column: string; |
|
|
|
|
|
|
|
opType: string; |
|
|
|
|
|
|
|
opSubType?: string; |
|
|
|
|
|
|
|
value?: string; |
|
|
|
|
|
|
|
result: { rowCount: number }; |
|
|
|
|
|
|
|
dataType?: string; |
|
|
|
|
|
|
|
}) { |
|
|
|
|
|
|
|
// if opType was included in skip list, skip it
|
|
|
|
|
|
|
|
if (skipList[param.column]?.includes(param.opType)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await toolbar.filter.add({ |
|
|
|
|
|
|
|
columnTitle: param.column, |
|
|
|
|
|
|
|
opType: param.opType, |
|
|
|
|
|
|
|
opSubType: param.opSubType, |
|
|
|
|
|
|
|
value: param.value, |
|
|
|
|
|
|
|
isLocallySaved: false, |
|
|
|
|
|
|
|
dataType: param?.dataType, |
|
|
|
|
|
|
|
openModal: true, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// verify filtered rows
|
|
|
|
|
|
|
|
await validateRowArray({ |
|
|
|
|
|
|
|
rowCount: param.result.rowCount, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function verifyFilter(param: { |
|
|
|
async function verifyFilter(param: { |
|
|
|
column: string; |
|
|
|
column: string; |
|
|
|
opType: string; |
|
|
|
opType: string; |
|
|
@ -348,8 +377,9 @@ test.describe('Filter Tests: Text based', () => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await toolbar.clickFilter(); |
|
|
|
for (let i = 0; i < filterList.length; i++) { |
|
|
|
for (let i = 0; i < filterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: filterList[i].op, |
|
|
|
opType: filterList[i].op, |
|
|
|
value: filterList[i].value, |
|
|
|
value: filterList[i].value, |
|
|
@ -612,7 +642,7 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
const oneYearAgo = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).setHours(0, 0, 0, 0); |
|
|
|
const oneYearAgo = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).setHours(0, 0, 0, 0); |
|
|
|
const oneYearFromNow = new Date(new Date().setFullYear(new Date().getFullYear() + 1)).setHours(0, 0, 0, 0); |
|
|
|
const oneYearFromNow = new Date(new Date().setFullYear(new Date().getFullYear() + 1)).setHours(0, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
async function dateTimeBasedFilterTest(dataType, suiteName) { |
|
|
|
async function dateTimeBasedFilterTest(dataType) { |
|
|
|
await dashboard.closeTab({ title: 'Team & Auth' }); |
|
|
|
await dashboard.closeTab({ title: 'Team & Auth' }); |
|
|
|
await dashboard.treeView.openTable({ title: 'dateTimeBased' }); |
|
|
|
await dashboard.treeView.openTable({ title: 'dateTimeBased' }); |
|
|
|
|
|
|
|
|
|
|
@ -770,10 +800,12 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
switch (suiteName) { |
|
|
|
await toolbar.clickFilter(); |
|
|
|
case 'is_is_not': |
|
|
|
await toolbar.filter.clickAddFilter(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "is" filter list
|
|
|
|
for (let i = 0; i < isFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is', |
|
|
|
opType: 'is', |
|
|
|
opSubType: isFilterList[i].opSub, |
|
|
|
opSubType: isFilterList[i].opSub, |
|
|
@ -785,7 +817,7 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
|
|
|
|
|
|
|
|
// mutually exclusive of "is" filter list
|
|
|
|
// mutually exclusive of "is" filter list
|
|
|
|
for (let i = 0; i < isFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is not', |
|
|
|
opType: 'is not', |
|
|
|
opSubType: isFilterList[i].opSub, |
|
|
|
opSubType: isFilterList[i].opSub, |
|
|
@ -794,11 +826,10 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
dataType: dataType, |
|
|
|
dataType: dataType, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'is_before_is_on_or_before': |
|
|
|
// "is before" filter list
|
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is before', |
|
|
|
opType: 'is before', |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
@ -808,8 +839,9 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "is on or before" filter list
|
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is on or before', |
|
|
|
opType: 'is on or before', |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
@ -818,11 +850,10 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
dataType: dataType, |
|
|
|
dataType: dataType, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'is_after_is_on_or_after': |
|
|
|
// "is after" filter list
|
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is after', |
|
|
|
opType: 'is after', |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
@ -832,8 +863,9 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "is on or after" filter list
|
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isAfterFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is on or after', |
|
|
|
opType: 'is on or after', |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
|
opSubType: isAfterFilterList[i].opSub, |
|
|
@ -842,11 +874,10 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
dataType: dataType, |
|
|
|
dataType: dataType, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'is_within_is_blank': |
|
|
|
// "is within" filter list
|
|
|
|
for (let i = 0; i < isWithinFilterList.length; i++) { |
|
|
|
for (let i = 0; i < isWithinFilterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: 'is within', |
|
|
|
opType: 'is within', |
|
|
|
opSubType: isWithinFilterList[i].opSub, |
|
|
|
opSubType: isWithinFilterList[i].opSub, |
|
|
@ -856,8 +887,9 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "is blank" and "is not blank" filter list
|
|
|
|
for (let i = 0; i < filterList.length; i++) { |
|
|
|
for (let i = 0; i < filterList.length; i++) { |
|
|
|
await verifyFilter({ |
|
|
|
await verifyFilter_withFixedModal({ |
|
|
|
column: dataType, |
|
|
|
column: dataType, |
|
|
|
opType: filterList[i].opType, |
|
|
|
opType: filterList[i].opType, |
|
|
|
opSubType: null, |
|
|
|
opSubType: null, |
|
|
@ -866,11 +898,6 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
dataType: dataType, |
|
|
|
dataType: dataType, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => { |
|
|
|
test.beforeEach(async ({ page }) => { |
|
|
@ -921,20 +948,8 @@ test.describe('Filter Tests: Date based', () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
test('Date : is, is not', async () => { |
|
|
|
test('Date : filters', async () => { |
|
|
|
await dateTimeBasedFilterTest('Date', 'is_is_not'); |
|
|
|
await dateTimeBasedFilterTest('Date'); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('Date : is before, is on or before', async () => { |
|
|
|
|
|
|
|
await dateTimeBasedFilterTest('Date', 'is_before_is_on_or_before'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('Date : is after, is on or after', async () => { |
|
|
|
|
|
|
|
await dateTimeBasedFilterTest('Date', 'is_after_is_on_or_after'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('Date : is within, is blank', async () => { |
|
|
|
|
|
|
|
await dateTimeBasedFilterTest('Date', 'is_within_is_blank'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|