summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/dashboard-v3.po.ts
blob: 597d2db9b50884cbb0edcd7ba651cdc8ce2bc5c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { PageHelper } from '../page-helper.po';

export class DashboardV3PageHelper extends PageHelper {
  pages = { index: { url: '#/dashboard', id: 'cd-dashboard-v3' } };

  cardTitle(index: number) {
    return cy.get('.card-title').its(index).text();
  }

  clickInventoryCardLink(link: string) {
    console.log(link);
    cy.get(`cd-card[cardTitle="Inventory"]`).contains('a', link).click();
  }

  card(indexOrTitle: number) {
    cy.get('cd-card').as('cards');

    return cy.get('@cards').its(indexOrTitle);
  }
}