1. Fix the timeout error happening in the dashboard e2e job
2. Take care of the flaky force maintenance check
Most of the time our test is getting timed out while searching for an item
in the table. Its because `.clear().type()` is not clearing the content
in the search field sometimes and that creates a wrong data to be
entered into the search field and it starts searching based on this
wrong name. To avoid this I am explicitly clearing the search area
before typing.
Fixes: https://tracker.ceph.com/issues/53672
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit
fed358d7c5a21cc76cae7042975f7e47ac3f8d50)
cy.get('[data-cy=submitBtn]').click();
// Enter config setting name into filter box
- this.seachTable(name);
+ this.searchTable(name);
// Expand row
this.getExpandCollapseElement(name).click();
cy.get('[data-cy=submitBtn]').click();
// Enter config setting name into filter box
- this.seachTable(name);
+ this.searchTable(name);
// Checks for visibility of config in table
this.getExpandCollapseElement(name).should('be.visible').click();
}
checkExist(hostname: string, exist: boolean) {
- this.clearTableSearchInput();
this.getTableCell(this.columnIndex.hostname, hostname).should(($elements) => {
const hosts = $elements.map((_, el) => el.textContent).get();
if (exist) {
@PageHelper.restrictTo(pages.index.url)
maintenance(hostname: string, exit = false, force = false) {
+ this.clearTableSearchInput();
if (force) {
this.getTableCell(this.columnIndex.hostname, hostname).click();
this.clickActionButton('enter-maintenance');
@PageHelper.restrictTo(pages.index.url)
checkStatus(id: number, status: string[]) {
- this.seachTable(`id:${id}`);
+ this.searchTable(`id:${id}`);
this.expectTableCount('found', 1);
cy.get(`datatable-body-cell:nth-child(${this.columnIndex.status}) .badge`).should(($ele) => {
const allStatus = $ele.toArray().map((v) => v.innerText);
@PageHelper.restrictTo(pages.index.url)
ensureNoOsd(id: number) {
- this.seachTable(`id:${id}`);
+ this.searchTable(`id:${id}`);
this.expectTableCount('found', 0);
this.clearTableSearchInput();
}
}
checkServiceStatus(daemon: string) {
- this.getTableCell(this.serviceDetailColumnIndex.daemonType, daemon)
- .parent()
- .find(`datatable-body-cell:nth-child(${this.serviceDetailColumnIndex.status}) .badge`)
- .should(($ele) => {
- const status = $ele.toArray().map((v) => v.innerText);
- expect(status).to.include('running');
- });
+ cy.get('cd-service-daemon-list').within(() => {
+ this.getTableCell(this.serviceDetailColumnIndex.daemonType, daemon)
+ .parent()
+ .find(`datatable-body-cell:nth-child(${this.serviceDetailColumnIndex.status}) .badge`)
+ .should(($ele) => {
+ const status = $ele.toArray().map((v) => v.innerText);
+ expect(status).to.include('running');
+ });
+ });
}
expectPlacementCount(serviceName: string, expectedCount: string) {
});
});
- it('should force maintenance and exit', { retries: 1 }, () => {
- hosts.maintenance(hostnames[3], true, true);
- });
-
it('should drain, remove and add the host back', () => {
hosts.drain(hostnames[1]);
hosts.remove(hostnames[1]);
hosts.add(hostnames[1]);
hosts.checkExist(hostnames[1], true);
});
+
+ it('should force maintenance and exit', { retries: 1 }, () => {
+ hosts.maintenance(hostnames[3], true, true);
+ });
});
describe('OSDs page', () => {
getTableRow(content: string) {
this.waitDataTableToLoad();
- this.seachTable(content);
+ this.searchTable(content);
return cy.contains('.datatable-body-row', content);
}
this.waitDataTableToLoad();
if (content) {
- this.seachTable(content);
+ this.searchTable(content);
return cy.contains('.datatable-body-cell-label', content);
} else {
return cy.get('.datatable-body-cell-label').first();
getTableCell(columnIndex: number, exactContent: string) {
this.waitDataTableToLoad();
- this.seachTable(exactContent);
+ this.clearTableSearchInput();
+ this.searchTable(exactContent);
return cy.contains(
`datatable-body-row datatable-body-cell:nth-child(${columnIndex})`,
new RegExp(`^${exactContent}$`)
cy.get('cd-table .dataTables_paginate input').first().clear({ force: true }).type(size);
}
- seachTable(text: string) {
+ searchTable(text: string) {
this.waitDataTableToLoad();
this.setPageSize('10');
clearTableSearchInput() {
this.waitDataTableToLoad();
- return cy.get('cd-table .search button').click();
+ return cy.get('cd-table .search button').first().click();
}
// Click the action button