]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/role-mgmt.po.ts
buildsys: change download over to reef release
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / ui / role-mgmt.po.ts
1 import { PageHelper } from '../page-helper.po';
2
3 export class RoleMgmtPageHelper extends PageHelper {
4 pages = {
5 index: { url: '#/user-management/roles', id: 'cd-role-list' },
6 create: { url: '#/user-management/roles/create', id: 'cd-role-form' }
7 };
8
9 create(name: string, description: string) {
10 this.navigateTo('create');
11 // Waits for data to load
12 cy.contains('grafana');
13
14 // fill in fields
15 cy.get('#name').type(name);
16 cy.get('#description').type(description);
17
18 // Click the create button and wait for role to be made
19 cy.get('[data-cy=submitBtn]').click();
20 cy.get('.breadcrumb-item.active').should('not.have.text', 'Create');
21
22 this.getFirstTableCell(name).should('exist');
23 }
24
25 edit(name: string, description: string) {
26 this.navigateEdit(name);
27 // Waits for data to load
28 cy.contains('grafana');
29
30 // fill in fields with new values
31 cy.get('#description').clear().type(description);
32
33 // Click the edit button and check new values are present in table
34 cy.get('[data-cy=submitBtn]').click();
35 cy.get('.breadcrumb-item.active').should('not.have.text', 'Edit');
36
37 this.getFirstTableCell(name).should('exist');
38 this.getFirstTableCell(description).should('exist');
39 }
40 }