});
describe('edit configuration test', () => {
+ const configName = 'client_cache_size';
+
beforeAll(async () => {
await configuration.navigateTo();
});
- it('should click and edit a configuration and results should appear in the table', async () => {
- const configName = 'client_cache_size';
+ beforeEach(async () => {
+ await configuration.clearTableSearchInput();
+ });
+
+ afterAll(async () => {
+ await configuration.configClear(configName);
+ });
+ it('should click and edit a configuration and results should appear in the table', async () => {
await configuration.edit(
configName,
['global', '1'],
['mds', '5'],
['client', '6']
);
- await configuration.configClear(configName);
+ });
+
+ it('should show only modified configurations', async () => {
+ await configuration.filterTable('Modified', 'yes');
+ expect(await configuration.getTableFoundCount()).toBe(1);
+ });
+
+ it('should hide all modified configurations', async () => {
+ await configuration.filterTable('Modified', 'no');
+ expect(await configuration.getTableFoundCount()).toBeGreaterThan(1);
});
});
});
return Number(text.match(/(\d+)\s+selected/)[1]);
}
+ async getTableFoundCount(): Promise<number> {
+ const text = await $$('.datatable-footer-inner .page-count span')
+ .filter(async (e) => (await e.getText()).includes('found'))
+ .first()
+ .getText();
+ return Number(text.match(/(\d+)\s+found/)[1]);
+ }
+
getFirstTableCellWithText(content: string): ElementFinder {
return element.all(by.cssContainingText('.datatable-body-cell-label', content)).first();
}
(e: ElementFinder) => e.click()
);
}
+
+ async filterTable(name: string, option: string) {
+ await this.waitClickableAndClick($('.tc_filter_name > a'));
+ await element(by.cssContainingText(`.tc_filter_name .dropdown-item`, name)).click();
+
+ await this.waitClickableAndClick($('.tc_filter_option > a'));
+ await element(by.cssContainingText(`.tc_filter_option .dropdown-item`, option)).click();
+ }
+
+ async clearTableSearchInput() {
+ return this.waitClickableAndClick($('cd-table .search button'));
+ }
}
}
return row.source.includes(value);
}
+ },
+ {
+ name: this.i18n('Modified'),
+ prop: 'modified',
+ filterOptions: ['yes', 'no'],
+ filterPredicate: (row, value) => {
+ if (value === 'yes' && row.hasOwnProperty('value')) {
+ return true;
+ }
+
+ if (value === 'no' && !row.hasOwnProperty('value')) {
+ return true;
+ }
+
+ return false;
+ }
}
];
<div *ngIf="columnFilters.length !== 0"
class="btn-group widget-toolbar">
<div dropdown
- class="btn-group">
+ class="btn-group tc_filter_name">
<a dropdownToggle
- class="btn btn-light dropdown-toggle tc_columnBtn"
+ class="btn btn-light dropdown-toggle"
data-toggle="dropdown">
<i [ngClass]="[icons.large, icons.filter]"></i>
{{ selectedFilter.column.name }}
</ul>
</div>
<div dropdown
- class="btn-group">
+ class="btn-group tc_filter_option">
<a dropdownToggle
class="btn btn-light dropdown-toggle"
[class.disabled]="selectedFilter.options.length === 0"