1 import { PageHelper } from '../page-helper.po';
3 export class LogsPageHelper extends PageHelper {
5 index: { url: '#/logs', id: 'cd-logs' }
8 checkAuditForPoolFunction(poolname: string, poolfunction: string, hour: number, minute: number) {
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');
15 // go to audit logs tab
16 cy.contains('.nav-link', 'Audit Logs').click();
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();
22 cy.get('.bs-timepicker-field').its(0).type('0');
24 cy.get('.bs-timepicker-field').its(0).type(`${hour}`);
26 cy.get('.bs-timepicker-field').its(1).clear();
28 cy.get('.bs-timepicker-field').its(1).type('0');
30 cy.get('.bs-timepicker-field').its(1).type(`${minute}`);
32 // Enter the pool name into the filter box
33 cy.get('input.form-control.ng-valid').first().clear().type(poolname);
35 cy.get('.tab-pane.active')
38 .should('contain.text', poolname)
39 .and('contain.text', `pool ${poolfunction}`);
42 checkAuditForConfigChange(configname: string, setting: string, hour: number, minute: number) {
45 // go to audit logs tab
46 cy.contains('.nav-link', 'Audit Logs').click();
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();
51 cy.get('.bs-timepicker-field').its(0).type('0');
53 cy.get('.bs-timepicker-field').its(0).type(`${hour}`);
55 cy.get('.bs-timepicker-field').its(1).clear();
57 cy.get('.bs-timepicker-field').its(1).type('0');
59 cy.get('.bs-timepicker-field').its(1).type(`${minute}`);
61 // Enter the config name into the filter box
62 cy.get('input.form-control.ng-valid').first().clear().type(configname);
64 cy.get('.tab-pane.active')
67 .should('contain.text', configname)
68 .and('contain.text', setting);