From 389020e14594e4894e28d1eb9103c210b142509e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:13 +0200 Subject: Adding upstream version 18.2.3. Signed-off-by: Daniel Baumann --- .../cypress/e2e/common/table-helper.feature.po.ts | 13 ++++++ .../e2e/filesystems/snapshots.e2e-spec.feature | 53 ++++++++++++++++++++++ .../filesystems/subvolume-groups.e2e-spec.feature | 4 +- .../cypress/e2e/orchestrator/04-osds.e2e-spec.ts | 10 ++++ .../workflow/10-nfs-exports.e2e-spec.ts | 2 +- .../frontend/cypress/e2e/rgw/buckets.e2e-spec.ts | 6 +-- .../frontend/cypress/e2e/rgw/buckets.po.ts | 24 ++-------- .../frontend/cypress/e2e/rgw/roles.e2e-spec.ts | 14 +++++- .../dashboard/frontend/cypress/e2e/rgw/roles.po.ts | 26 +++++++++-- .../frontend/cypress/e2e/ui/language.e2e-spec.ts | 2 +- .../cypress/e2e/visualTests/dashboard.vrt-spec.ts | 2 +- .../cypress/e2e/visualTests/login.vrt-spec.ts | 2 +- 12 files changed, 123 insertions(+), 35 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature (limited to 'src/pybind/mgr/dashboard/frontend/cypress/e2e') diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts index 82a2c7c35..330950acd 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/table-helper.feature.po.ts @@ -54,6 +54,13 @@ Then('I should not see a row with {string}', (row: string) => { ); }); +Then('I should see a table in the expanded row', () => { + cy.get('.datatable-row-detail').within(() => { + cy.get('cd-table').should('exist'); + cy.get('datatable-scroller, .empty-row'); + }); +}); + Then('I should not see a row with {string} in the expanded row', (row: string) => { cy.get('.datatable-row-detail').within(() => { cy.get('cd-table .search input').first().clear().type(row); @@ -133,3 +140,9 @@ And('I should see row {string} have {string} on this tab', (row: string, options }); } }); + +Then('I should see an alert {string} in the expanded row', (alert: string) => { + cy.get('.datatable-row-detail').within(() => { + cy.get('.alert-panel-text').contains(alert); + }); +}); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature new file mode 100644 index 000000000..002282172 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature @@ -0,0 +1,53 @@ +Feature: CephFS Snapshot Management + + Goal: To test out the CephFS snapshot management features + + Background: Login + Given I am logged in + + Scenario: Create a CephFS Volume + Given I am on the "cephfs" page + And I click on "Create" button + And enter "name" "test_cephfs" + And I click on "Create File System" button + Then I should see a row with "test_cephfs" + + Scenario: Snapshots tab without a subvolume + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Snapshots" tab + Then I should see an alert "No subvolumes are present" in the expanded row + + Scenario: Create a CephFS Subvolume + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Subvolumes" tab + And I click on "Create" button from the expanded row + And enter "subvolumeName" "test_subvolume" in the modal + And I click on "Create Subvolume" button + Then I should see a row with "test_subvolume" in the expanded row + + Scenario: Show the CephFS Snapshots view + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Snapshots" tab + Then I should see a table in the expanded row + + Scenario: Remove a CephFS Subvolume + Given I am on the "cephfs" page + When I expand the row "test_cephfs" + And I go to the "Subvolumes" tab + When I select a row "test_subvolume" in the expanded row + And I click on "Remove" button from the table actions in the expanded row + And I check the tick box in modal + And I click on "Remove Subvolume" button + Then I should not see a row with "test_subvolume" in the expanded row + + Scenario: Remove CephFS Volume + Given I am on the "cephfs" page + And I select a row "test_cephfs" + And I click on "Remove" button from the table actions + Then I should see the modal + And I check the tick box in modal + And I click on "Remove File System" button + Then I should not see a row with "test_cephfs" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature index 66e3f726a..e53df6477 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature @@ -21,7 +21,7 @@ Feature: CephFS Subvolume Group management And I click on "Create Subvolume group" button Then I should see a row with "test_subvolume_group" in the expanded row - Scenario: Edit a CephFS Subvolume + Scenario: Edit a CephFS Subvolume Group Given I am on the "cephfs" page When I expand the row "test_cephfs" And I go to the "Subvolume groups" tab @@ -31,7 +31,7 @@ Feature: CephFS Subvolume Group management And I click on "Edit Subvolume group" button Then I should see row "test_subvolume_group" of the expanded row to have a usage bar - Scenario: Remove a CephFS Subvolume + Scenario: Remove a CephFS Subvolume Group Given I am on the "cephfs" page When I expand the row "test_cephfs" And I go to the "Subvolume groups" tab diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts index e80398d5a..74b46054a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/04-osds.e2e-spec.ts @@ -1,9 +1,19 @@ import { OSDsPageHelper } from '../cluster/osds.po'; import { DashboardPageHelper } from '../ui/dashboard.po'; +import { ManagerModulesPageHelper } from '../cluster/mgr-modules.po'; describe('OSDs page', () => { const osds = new OSDsPageHelper(); const dashboard = new DashboardPageHelper(); + const mgrmodules = new ManagerModulesPageHelper(); + + before(() => { + cy.login(); + mgrmodules.navigateTo(); + mgrmodules.navigateEdit('dashboard'); + cy.get('#FEATURE_TOGGLE_DASHBOARD').uncheck(); + cy.contains('button', 'Update').click(); + }); beforeEach(() => { cy.login(); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/10-nfs-exports.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/10-nfs-exports.e2e-spec.ts index 6380e5a13..fdd96d7e9 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/10-nfs-exports.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/10-nfs-exports.e2e-spec.ts @@ -41,7 +41,7 @@ describe('nfsExport page', () => { it('should create a nfs-export with RGW backend', () => { buckets.navigateTo('create'); - buckets.create(bucketName, 'dashboard', 'default-placement'); + buckets.create(bucketName, 'dashboard'); nfsExport.navigateTo(); nfsExport.existTableCell(rgwPseudo, false); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts index 99c0732fc..8b05c309f 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts @@ -18,7 +18,7 @@ describe('RGW buckets page', () => { describe('create, edit & delete bucket tests', () => { it('should create bucket', () => { buckets.navigateTo('create'); - buckets.create(bucket_name, BucketsPageHelper.USERS[0], 'default-placement'); + buckets.create(bucket_name, BucketsPageHelper.USERS[0]); buckets.getFirstTableCell(bucket_name).should('exist'); }); @@ -38,7 +38,7 @@ describe('RGW buckets page', () => { it('should create bucket with object locking enabled', () => { buckets.navigateTo('create'); - buckets.create(bucket_name, BucketsPageHelper.USERS[0], 'default-placement', true); + buckets.create(bucket_name, BucketsPageHelper.USERS[0], true); buckets.getFirstTableCell(bucket_name).should('exist'); }); @@ -57,7 +57,7 @@ describe('RGW buckets page', () => { it('should test invalid input in edit owner field', () => { buckets.navigateTo('create'); - buckets.create(bucket_name, BucketsPageHelper.USERS[0], 'default-placement'); + buckets.create(bucket_name, BucketsPageHelper.USERS[0]); buckets.testInvalidEdit(bucket_name); buckets.navigateTo(); buckets.delete(bucket_name); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts index 47b0639bc..91f852024 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts @@ -22,16 +22,12 @@ export class BucketsPageHelper extends PageHelper { return this.selectOption('owner', owner); } - private selectPlacementTarget(placementTarget: string) { - return this.selectOption('placement-target', placementTarget); - } - private selectLockMode(lockMode: string) { return this.selectOption('lock_mode', lockMode); } @PageHelper.restrictTo(pages.create.url) - create(name: string, owner: string, placementTarget: string, isLocking = false) { + create(name: string, owner: string, isLocking = false) { // Enter in bucket name cy.get('#bid').type(name); @@ -39,10 +35,6 @@ export class BucketsPageHelper extends PageHelper { this.selectOwner(owner); cy.get('#owner').should('have.class', 'ng-valid'); - // Select bucket placement target: - this.selectPlacementTarget(placementTarget); - cy.get('#placement-target').should('have.class', 'ng-valid'); - if (isLocking) { cy.get('#lock_enabled').click({ force: true }); // Select lock mode: @@ -59,7 +51,6 @@ export class BucketsPageHelper extends PageHelper { @PageHelper.restrictTo(pages.create.url) checkForDefaultEncryption() { - cy.get("cd-helper[aria-label='toggle encryption helper']").click(); cy.get("a[aria-label='click here']").click(); cy.get('cd-modal').within(() => { cy.get('input[id=s3Enabled]').should('be.checked'); @@ -70,7 +61,9 @@ export class BucketsPageHelper extends PageHelper { edit(name: string, new_owner: string, isLocking = false) { this.navigateEdit(name); - cy.get('input[name=placement-target]').should('have.value', 'default-placement'); + // Placement target is not allowed to be edited and should be hidden + cy.get('input[name=placement-target]').should('not.exist'); + this.selectOwner(new_owner); // If object locking is enabled versioning shouldn't be visible @@ -171,15 +164,6 @@ export class BucketsPageHelper extends PageHelper { // Check that error message was printed under owner drop down field cy.get('#owner + .invalid-feedback').should('have.text', 'This field is required.'); - // Check invalid placement target input - this.selectOwner(BucketsPageHelper.USERS[1]); - // The drop down error message will not appear unless a valid option is previsously selected. - this.selectPlacementTarget('default-placement'); - this.selectPlacementTarget('-- Select a placement target --'); - cy.get('@nameInputField').click(); // Trigger validation - cy.get('#placement-target').should('have.class', 'ng-invalid'); - cy.get('#placement-target + .invalid-feedback').should('have.text', 'This field is required.'); - // Clicks the Create Bucket button but the page doesn't move. // Done by testing for the breadcrumb cy.contains('button', 'Create Bucket').click(); // Clicks Create Bucket button diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.e2e-spec.ts index 597f7d1be..80a8b0ec9 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.e2e-spec.ts @@ -9,11 +9,21 @@ describe('RGW roles page', () => { }); describe('Create, Edit & Delete rgw roles', () => { + const roleName = 'testRole'; + it('should create rgw roles', () => { roles.navigateTo('create'); - roles.create('testRole', '/', '{}'); + roles.create(roleName, '/', '{}'); roles.navigateTo(); - roles.checkExist('testRole', true); + roles.checkExist(roleName, true); + }); + + it('should edit rgw role', () => { + roles.edit(roleName, 3); + }); + + it('should delete rgw role', () => { + roles.delete(roleName); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts index b72ca5df9..717655b2f 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/roles.po.ts @@ -11,18 +11,36 @@ export class RolesPageHelper extends PageHelper { columnIndex = { roleName: 2, path: 3, - arn: 4 + arn: 4, + createDate: 5, + maxSessionDuration: 6 }; @PageHelper.restrictTo(pages.create.url) create(name: string, path: string, policyDocument: string) { - cy.get('#formly_3_string_role_name_0').type(name); - cy.get('#formly_3_textarea_role_assume_policy_doc_2').type(policyDocument); - cy.get('#formly_3_string_role_path_1').type(path); + cy.get('[id$="string_role_name_0"]').type(name); + cy.get('[id$="role_assume_policy_doc_2"]').type(policyDocument); + cy.get('[id$="role_path_1"]').type(path); cy.get("[aria-label='Create Role']").should('exist').click(); cy.get('cd-crud-table').should('exist'); } + edit(name: string, maxSessionDuration: number) { + this.navigateEdit(name); + cy.get('[id$="max_session_duration_1"]').clear().type(maxSessionDuration.toString()); + cy.get("[aria-label='Edit Role']").should('exist').click(); + cy.get('cd-crud-table').should('exist'); + + this.getTableCell(this.columnIndex.roleName, name) + .click() + .parent() + .find(`datatable-body-cell:nth-child(${this.columnIndex.maxSessionDuration})`) + .should(($elements) => { + const roleName = $elements.map((_, el) => el.textContent).get(); + expect(roleName).to.include(`${maxSessionDuration} hours`); + }); + } + @PageHelper.restrictTo(pages.index.url) checkExist(name: string, exist: boolean) { this.getTableCell(this.columnIndex.roleName, name).should(($elements) => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.e2e-spec.ts index fa20f0be5..86b170d43 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/language.e2e-spec.ts @@ -14,6 +14,6 @@ describe('Shared pages', () => { it('should check all available languages', () => { language.getLanguageBtn().click(); - language.getAllLanguages().should('have.length', 1).should('contain.text', 'English'); + language.getAllLanguages().should('have.length', 13).should('contain.text', 'English'); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/dashboard.vrt-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/dashboard.vrt-spec.ts index 450cff871..138029820 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/dashboard.vrt-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/dashboard.vrt-spec.ts @@ -1,6 +1,6 @@ import { LoginPageHelper } from '../ui/login.po'; -describe('Dashboard Landing Page', () => { +describe.skip('Dashboard Landing Page', () => { const login = new LoginPageHelper(); beforeEach(() => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/login.vrt-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/login.vrt-spec.ts index ea74f1d0f..bc41c29c6 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/login.vrt-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/visualTests/login.vrt-spec.ts @@ -1,4 +1,4 @@ -describe('Login Page', () => { +describe.skip('Login Page', () => { beforeEach(() => { cy.visit('#/login'); cy.eyesOpen({ -- cgit v1.2.3