]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/ui/notification.e2e-spec.ts
b69f26f58dc3818fc5ad61798d1832e1870dd1c9
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / ui / notification.e2e-spec.ts
1 import { PoolPageHelper } from '../pools/pools.po';
2 import { NotificationSidebarPageHelper } from './notification.po';
3
4 describe('Notification page', () => {
5 const notification = new NotificationSidebarPageHelper();
6 const pools = new PoolPageHelper();
7 const poolName = 'e2e_notification_pool';
8
9 before(() => {
10 cy.login();
11 pools.navigateTo('create');
12 pools.create(poolName, 8);
13 pools.edit_pool_pg(poolName, 4, false);
14 });
15
16 after(() => {
17 cy.login();
18 pools.navigateTo();
19 pools.delete(poolName);
20 });
21
22 beforeEach(() => {
23 cy.login();
24 pools.navigateTo();
25 });
26
27 it('should open notification sidebar', () => {
28 notification.getSidebar().should('not.be.visible');
29 notification.open();
30 notification.getSidebar().should('be.visible');
31 });
32
33 it('should display a running task', () => {
34 notification.getToast().should('not.exist');
35
36 // Check that running task is shown.
37 notification.open();
38 notification.getTasks().contains(poolName).should('exist');
39
40 // Delete pool after task is complete (otherwise we get an error).
41 notification.getTasks().contains(poolName, { timeout: 300000 }).should('not.exist');
42 });
43
44 it('should have notifications', () => {
45 notification.open();
46 notification.getNotifications().should('have.length.gt', 0);
47 });
48
49 it('should clear notifications', () => {
50 notification.getToast().should('not.exist');
51 notification.open();
52 notification.getNotifications().should('have.length.gt', 0);
53 notification.getClearNotficationsBtn().should('be.visible');
54 notification.clearNotifications();
55 });
56 });