From f89837681640667159a41c99c312ebf0f8d0995c Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Fri, 21 Mar 2025 11:28:45 +0530 Subject: [PATCH] mgr/dashboard: e2e for cephfs creation with existing pools Fixes: https://tracker.ceph.com/issues/70600 Signed-off-by: Nizamudeen A --- .../e2e/common/forms-helper.feature.po.ts | 12 ++++- .../frontend/cypress/e2e/common/urls.po.ts | 6 ++- .../filesystems/filesystems.e2e-spec.feature | 44 +++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts index 6af9dd842d6..dcc1a159210 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts @@ -9,6 +9,14 @@ And('enter {string} {string}', (field: string, value: string) => { cy.get(`input[id=${field}]`).clear().type(value); }); +/** + * Ticks a checkbox in the form + * @param field name of the field that needs to be filled out. + */ +And('checks {string}', (field: string) => { + cy.get('cds-checkbox span').contains(field).click(); +}); + /** * Fills in the given field using the value provided * @param field ID of the field that needs to be filled out. @@ -95,6 +103,6 @@ Then('I should see an error in {string} field', (field: string) => { }); And('select {string} {string}', (selectionName: string, option: string) => { - cy.get(`select[name=${selectionName}]`).select(option); - cy.get(`select[name=${selectionName}] option:checked`).contains(option); + cy.get(`select[id=${selectionName}]`).select(option); + cy.get(`select[id=${selectionName}] option:checked`).contains(option); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts index 5b664f96748..455fdf2cf93 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/urls.po.ts @@ -43,6 +43,10 @@ export class UrlsCollection extends PageHelper { // CephFS cephfs: { url: '#/cephfs/fs', id: 'cd-cephfs-list' }, - 'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' } + 'create cephfs': { url: '#/cephfs/fs/create', id: 'cd-cephfs-form' }, + + // Pools + pools: { url: '/#pool', id: 'cd-pool-list' }, + 'create pool': { url: '#/pool/create', id: 'cd-pool-form' } }; } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature index 13921249f08..7ce0fb2ecea 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature @@ -29,3 +29,47 @@ Feature: CephFS Management And I confirm the resource "test_cephfs" And I click on "Remove File System" button Then I should not see a row with "test_cephfs" + + Scenario Outline: Create two cephfs pools for attaching to a volume + Given I am on the "create pool" page + And enter "name" "" + And select "poolType" "" + And select options "" + And I click on "Create Pool" button + Then I should see a row with "" + + Examples: + | pool_name | type | application | + | e2e_cephfs_data | replicated | cephfs | + | e2e_cephfs_meta | replicated | cephfs | + + Scenario Outline: Create a CephFS Volume with pre-created pools + Given I am on the "create cephfs" page + And enter "name" "" + And checks "Use existing pools" + And select "dataPool" "" + And select "metadataPool" "" + And I click on "Create File System" button + Then I should see a row with "" + + Examples: + | fs_name | data_pool | metadata_pool | + | e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta | + + Scenario Outline: Remove CephFS Volume that has pre-created pools + Given I am on the "cephfs" page + And I select a row "" + And I click on "Remove" button from the table actions + Then I should see the carbon modal + And I confirm the resource "" + And I click on "Remove File System" button + Then I should not see a row with "" + + # verify pools associated with the volume is removed + Given I am on the "pools" page + Then I should not see a row with "" + And I should not see a row with "" + + Examples: + | fs_name | data_pool | metadata_pool | + | e2e_custom_pool_cephfs | e2e_cephfs_data | e2e_cephfs_meta | -- 2.39.5