]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / e2e / cluster / logs.e2e-spec.ts
CommitLineData
9f95a23c
TL
1import { PoolPageHelper } from '../pools/pools.po';
2import { ConfigurationPageHelper } from './configuration.po';
3import { LogsPageHelper } from './logs.po';
11fdf7f2
TL
4
5describe('Logs page', () => {
9f95a23c
TL
6 let logs: LogsPageHelper;
7 let pools: PoolPageHelper;
8 let configuration: ConfigurationPageHelper;
9
10 const poolname = 'logs_e2e_test_pool';
11 const configname = 'log_graylog_port';
12 const today = new Date();
13 let hour = today.getHours();
14 if (hour > 12) {
15 hour = hour - 12;
16 }
17 const minute = today.getMinutes();
11fdf7f2
TL
18
19 beforeAll(() => {
9f95a23c
TL
20 logs = new LogsPageHelper();
21 pools = new PoolPageHelper();
22 configuration = new ConfigurationPageHelper();
11fdf7f2
TL
23 });
24
9f95a23c
TL
25 afterEach(async () => {
26 await LogsPageHelper.checkConsole();
11fdf7f2
TL
27 });
28
9f95a23c
TL
29 describe('breadcrumb and tab tests', () => {
30 beforeAll(async () => {
31 await logs.navigateTo();
32 });
33
34 it('should open and show breadcrumb', async () => {
35 await logs.waitTextToBePresent(logs.getBreadcrumb(), 'Logs');
36 });
11fdf7f2 37
9f95a23c
TL
38 it('should show two tabs', async () => {
39 await expect(logs.getTabsCount()).toEqual(2);
40 });
41
42 it('should show cluster logs tab at first', async () => {
43 await expect(logs.getTabText(0)).toEqual('Cluster Logs');
44 });
45
46 it('should show audit logs as a second tab', async () => {
47 await expect(logs.getTabText(1)).toEqual('Audit Logs');
48 });
11fdf7f2
TL
49 });
50
9f95a23c
TL
51 describe('audit logs respond to pool creation and deletion test', () => {
52 it('should create pool and check audit logs reacted', async () => {
53 await pools.navigateTo('create');
54 await pools.create(poolname, 8);
55
56 await pools.navigateTo();
57 await pools.exist(poolname, true);
58
59 await logs.checkAuditForPoolFunction(poolname, 'create', hour, minute);
60 });
61
62 it('should delete pool and check audit logs reacted', async () => {
63 await pools.navigateTo();
64 await pools.delete(poolname);
65
66 await logs.navigateTo();
67 await logs.checkAuditForPoolFunction(poolname, 'delete', hour, minute);
68 });
11fdf7f2
TL
69 });
70
9f95a23c
TL
71 describe('audit logs respond to editing configuration setting test', () => {
72 it('should change config settings and check audit logs reacted', async () => {
73 await configuration.navigateTo();
74 await configuration.edit(configname, ['global', '5']);
75
76 await logs.navigateTo();
77 await logs.checkAuditForConfigChange(configname, 'global', hour, minute);
78
79 await configuration.navigateTo();
80 await configuration.configClear(configname);
81 });
11fdf7f2
TL
82 });
83});