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