]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/cluster/logs.po.ts
import 15.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / cluster / logs.po.ts
1 import { PageHelper } from '../page-helper.po';
2
3 export class LogsPageHelper extends PageHelper {
4 pages = {
5 index: { url: '#/logs', id: 'cd-logs' }
6 };
7
8 checkAuditForPoolFunction(poolname: string, poolfunction: string, hour: number, minute: number) {
9 this.navigateTo();
10
11 // sometimes the modal from deleting pool is still present at this point.
12 // This wait makes sure it isn't
13 cy.contains('.modal-dialog', 'Delete Pool').should('not.exist');
14
15 // go to audit logs tab
16 cy.contains('.nav-link', 'Audit Logs').click();
17
18 // Enter an earliest time so that no old messages with the same pool name show up
19 cy.get('.bs-timepicker-field').its(0).clear();
20
21 if (hour < 10) {
22 cy.get('.bs-timepicker-field').its(0).type('0');
23 }
24 cy.get('.bs-timepicker-field').its(0).type(`${hour}`);
25
26 cy.get('.bs-timepicker-field').its(1).clear();
27 if (minute < 10) {
28 cy.get('.bs-timepicker-field').its(1).type('0');
29 }
30 cy.get('.bs-timepicker-field').its(1).type(`${minute}`);
31
32 // Enter the pool name into the filter box
33 cy.get('input.form-control.ng-valid').first().clear().type(poolname);
34
35 cy.get('.tab-pane.active')
36 .get('.card-body')
37 .get('.message')
38 .should('contain.text', poolname)
39 .and('contain.text', `pool ${poolfunction}`);
40 }
41
42 checkAuditForConfigChange(configname: string, setting: string, hour: number, minute: number) {
43 this.navigateTo();
44
45 // go to audit logs tab
46 cy.contains('.nav-link', 'Audit Logs').click();
47
48 // Enter an earliest time so that no old messages with the same config name show up
49 cy.get('.bs-timepicker-field').its(0).clear();
50 if (hour < 10) {
51 cy.get('.bs-timepicker-field').its(0).type('0');
52 }
53 cy.get('.bs-timepicker-field').its(0).type(`${hour}`);
54
55 cy.get('.bs-timepicker-field').its(1).clear();
56 if (minute < 10) {
57 cy.get('.bs-timepicker-field').its(1).type('0');
58 }
59 cy.get('.bs-timepicker-field').its(1).type(`${minute}`);
60
61 // Enter the config name into the filter box
62 cy.get('input.form-control.ng-valid').first().clear().type(configname);
63
64 cy.get('.tab-pane.active')
65 .get('.card-body')
66 .get('.message')
67 .should('contain.text', configname)
68 .and('contain.text', setting);
69 }
70 }