]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: check .badge instead of text for expected label 40231/head
authorNizamudeen A <nia@redhat.com>
Mon, 8 Feb 2021 20:21:25 +0000 (01:51 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 19 Mar 2021 06:44:28 +0000 (12:14 +0530)
this change fixes a regression introduced by
8c5e31ec1a13bc53394eb2cb6880d74db169fac4 which broke the 01-hosts.e2e-spec.ts test
driven by test_dashboard_e2e.sh

Fixes: https://tracker.ceph.com/issues/49205
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 6156055a78e63cef0eede0670816a24c3a097b4c)

src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/hosts.po.ts

index 8e215bcaf0cf6ee189207d1336c25660bed57bd0..0785f5107274fe1140c5a54fcf21d85106a2560f 100644 (file)
@@ -106,9 +106,9 @@ export class HostsPageHelper extends PageHelper {
     // First find row with hostname, then find labels in the row
     this.getTableCell(this.columnIndex.hostname, hostname)
       .parent()
-      .find(`datatable-body-cell:nth-child(${this.columnIndex.labels})`)
+      .find(`datatable-body-cell:nth-child(${this.columnIndex.labels}) .badge`)
       .should(($ele) => {
-        const newLabels = $ele.text().split(', ');
+        const newLabels = $ele.toArray().map((v) => v.innerText);
         for (const label of labels) {
           if (add) {
             expect(newLabels).to.include(label);