From: Kiefer Chang Date: Wed, 2 Dec 2020 06:09:02 +0000 (+0800) Subject: mgr/dashboard: fix test_dashboard_e2e.sh errors X-Git-Tag: v16.1.0~301^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc0ee535485e75fef3dc719e69365e04e4a6b5de;p=ceph.git mgr/dashboard: fix test_dashboard_e2e.sh errors - Adapt changes in https://github.com/ceph/ceph/pull/35039. - Tweak the way to get row by OSD ID. Fixes: https://tracker.ceph.com/issues/48406 Signed-off-by: Kiefer Chang --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.po.ts index 7cd738b822e7..263dfd89ec16 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/osds.po.ts @@ -34,30 +34,23 @@ export class OSDsPageHelper extends PageHelper { cy.get(`cd-osd-creation-preview-modal .modal-footer .tc_submitButton`).click(); } - getRowByID(id: number) { - return this.getTableCell(this.columnIndex.id, `${id}`).parent(); - } - @PageHelper.restrictTo(pages.index.url) checkStatus(id: number, status: string[]) { - this.getRowByID(id) - .find(`datatable-body-cell:nth-child(${this.columnIndex.status}) .badge`) - .should(($ele) => { - const allStatus = $ele.toArray().map((v) => v.innerText); - for (const s of status) { - expect(allStatus).to.include(s); - } - }); + this.seachTable(`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); + for (const s of status) { + expect(allStatus).to.include(s); + } + }); } @PageHelper.restrictTo(pages.index.url) ensureNoOsd(id: number) { - cy.get(`datatable-body-row datatable-body-cell:nth-child(${this.columnIndex.id})`).should( - ($ele) => { - const osdIds = $ele.toArray().map((v) => v.innerText); - expect(osdIds).to.not.include(`${id}`); - } - ); + this.seachTable(`id:${id}`); + this.expectTableCount('found', 0); + this.clearTableSearchInput(); } @PageHelper.restrictTo(pages.index.url) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/04-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/04-osds.e2e-spec.ts index f1a66e0a9577..e80398d5a472 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/04-osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/04-osds.e2e-spec.ts @@ -29,6 +29,7 @@ describe('OSDs page', () => { dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} up`); dashboard.infoCardBody('OSDs').should('contain.text', `${expectedCount} in`); + cy.wait(30000); expect(Number(newCount)).to.be.gte(2); // Delete the first OSD we created osds.navigateTo(); @@ -36,10 +37,10 @@ describe('OSDs page', () => { osds.deleteByIDs([deleteOsdId], false); osds.ensureNoOsd(deleteOsdId); + cy.wait(30000); // Replace the second OSD we created const replaceID = Number(oldCount) + 1; osds.deleteByIDs([replaceID], true); - // deleting OSDs doesn't work in cephadm right now, skip checking osds.checkStatus(replaceID, ['destroyed']); }); });