]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/integration/block/images.e2e-spec.ts
import 15.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / integration / block / images.e2e-spec.ts
1 import { PoolPageHelper } from '../pools/pools.po';
2 import { ImagesPageHelper } from './images.po';
3
4 describe('Images page', () => {
5 const pools = new PoolPageHelper();
6 const images = new ImagesPageHelper();
7
8 const poolName = 'e2e_images_pool';
9
10 before(() => {
11 cy.login();
12 // Need pool for image testing
13 pools.navigateTo('create');
14 pools.create(poolName, 8, 'rbd');
15 pools.exist(poolName, true);
16 });
17
18 after(() => {
19 // Deletes images test pool
20 pools.navigateTo();
21 pools.delete(poolName);
22 pools.navigateTo();
23 pools.exist(poolName, false);
24 });
25
26 beforeEach(() => {
27 cy.login();
28 images.navigateTo();
29 });
30
31 it('should open and show breadcrumb', () => {
32 images.expectBreadcrumbText('Images');
33 });
34
35 it('should show four tabs', () => {
36 images.getTabsCount().should('eq', 4);
37 });
38
39 it('should show text for all tabs', () => {
40 images.getTabText(0).should('eq', 'Images');
41 images.getTabText(1).should('eq', 'Namespaces');
42 images.getTabText(2).should('eq', 'Trash');
43 images.getTabText(3).should('eq', 'Overall Performance');
44 });
45
46 describe('create, edit & delete image test', () => {
47 const imageName = 'e2e_images#image';
48 const newImageName = 'e2e_images#image_new';
49
50 it('should create image', () => {
51 images.createImage(imageName, poolName, '1');
52 images.getFirstTableCell(imageName).should('exist');
53 });
54
55 it('should edit image', () => {
56 images.editImage(imageName, poolName, newImageName, '2');
57 images.getFirstTableCell(newImageName).should('exist');
58 });
59
60 it('should delete image', () => {
61 images.delete(newImageName);
62 });
63 });
64
65 describe('move to trash, restore and purge image tests', () => {
66 const imageName = 'e2e_trash#image';
67 const newImageName = 'e2e_newtrash#image';
68
69 before(() => {
70 cy.login();
71 // Need image for trash testing
72 images.createImage(imageName, poolName, '1');
73 images.getFirstTableCell(imageName).should('exist');
74 });
75
76 it('should move the image to the trash', () => {
77 images.moveToTrash(imageName);
78 images.getFirstTableCell(imageName).should('exist');
79 });
80
81 it('should restore image to images table', () => {
82 images.restoreImage(imageName, newImageName);
83 images.getFirstTableCell(newImageName).should('exist');
84 });
85
86 it('should purge trash in images trash tab', () => {
87 images.getFirstTableCell(newImageName).should('exist');
88 images.moveToTrash(newImageName);
89 images.purgeTrash(newImageName, poolName);
90 });
91 });
92 });