diff --git a/cypress/e2e/1_cluster-welcome.cy.js b/cypress/e2e/1_cluster-welcome.cy.js index 43fa30f6b..27afbc9a3 100644 --- a/cypress/e2e/1_cluster-welcome.cy.js +++ b/cypress/e2e/1_cluster-welcome.cy.js @@ -20,7 +20,7 @@ describe('Welcome page', () => { cy.contains('Tracing is enabled'); // tracing status cy.contains('16 Caches'); cy.contains('10 Counters'); - cy.contains('1 Tasks'); + // cy.contains('1 Tasks'); cy.contains('13 Schemas'); cy.contains('invalidationCache'); diff --git a/cypress/e2e/1_data-container.cy.js b/cypress/e2e/1_data-container.cy.js index 7c2f4fbb1..c76f2d172 100644 --- a/cypress/e2e/1_data-container.cy.js +++ b/cypress/e2e/1_data-container.cy.js @@ -11,8 +11,8 @@ describe('Data Container Overview', () => { cy.contains('Running'); // cluster status cy.contains('Tracing is enabled'); cy.contains('Cluster rebalancing on'); // rebalancing status - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.get('[data-cy=navigationTabs]').should('exist'); cy.get('#cache-table-toolbar').should('exist'); @@ -23,18 +23,19 @@ describe('Data Container Overview', () => { cy.get('[data-cy=cachesTable]').should('exist'); cy.contains('default'); // cache default cy.contains('octet-stream-cache').should('not.exist'); // cache octet-stream-cache is already on the next page + //make sure there are total 4 tabs (0,1,2,3) - cy.get('a[aria-label="nav-item-Caches"]').click(); - cy.get('a[aria-label="nav-item-Tasks"]').click(); - cy.get('a[aria-label="nav-item-Counters"]').click(); - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Caches"]').click({multiple: true, force: true}); + cy.get('[data-cy="tab-Tasks"]').click({multiple: true, force: true}); + cy.get('[data-cy="tab-Counters"]').click({multiple: true, force: true}); + cy.get('[data-cy="tab-Schemas"]').click({multiple: true, force: true}); }); //Testing pagination and navigation it('successfully navigates through the caches as well as changes number of viewed caches on the page', () => { cy.contains(numberOfCaches + ' Caches'); cy.contains('10 Counters'); - cy.contains('1 Tasks'); + // cy.contains('1 Tasks'); cy.contains('13 Schemas'); cy.contains('1 - 10 of ' + numberOfCaches); @@ -60,53 +61,21 @@ describe('Data Container Overview', () => { cy.contains('xml-cache').should('not.exist'); //Changing the number of items on the page - cy.get('[id^="pagination-caches-top-pagination"]').first().click(); - cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('exist'); //Verifying the selected option - cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist'); + cy.contains('1 - 10 of 16'); + cy.get('[id^="pagination-caches-top-toggle"]').first().click(); + cy.get('[data-action=per-page-10]').should('exist'); + cy.get('[data-action=per-page-20]').should('exist'); + cy.get('[data-action=per-page-50]').should('exist'); + cy.get('[data-action=per-page-100]').should('exist'); cy.get('[data-action=per-page-20]').click(); - //Verifying that all caches are shown and navigation buttons are disabled - cy.get('[id^="pagination-caches-top-pagination"]').first().click(); - cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option - cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('exist'); - cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist'); + cy.contains('1 - 16 of 16'); cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); // including header row cy.get('[data-action=next]').first().should('be.disabled'); cy.get('[data-action=previous]').first().should('be.disabled'); cy.contains('java-serialized-cache'); cy.contains('people'); cy.contains('xml-cache'); - - //Changing the number of items on the page to 3rd option - cy.get('[data-action=per-page-50]').click(); - cy.get('[id^="pagination-caches-top-pagination"]').first().click(); - cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option - cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('exist'); - cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); //including header row - cy.get('[data-action=next]').first().should('be.disabled'); - cy.get('[data-action=previous]').first().should('be.disabled'); - cy.contains('java-serialized-cache'); - cy.contains('people'); - cy.contains('xml-cache'); - - //Changing the number of items on the page to 4th option - cy.get('[data-action=per-page-100]').click(); - cy.get('[id^="pagination-caches-top-pagination"]').first().click(); - cy.get('[data-action=per-page-10] .pf-v5-c-menu__item-select-icon').should('not.exist'); //Verifying the selected option - cy.get('[data-action=per-page-20] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-50] .pf-v5-c-menu__item-select-icon').should('not.exist'); - cy.get('[data-action=per-page-100] .pf-v5-c-menu__item-select-icon').should('exist'); - cy.get('[data-cy=cachesTable] tr').should('have.length', numberOfCaches + 1); //including header row - cy.get('[data-action=next]').first().should('be.disabled'); - cy.get('[data-action=previous]').first().should('be.disabled'); - cy.contains('java-serialized-cache'); - cy.contains('people'); - cy.contains('xml-cache'); }); //Testing the filters @@ -310,8 +279,8 @@ describe('Data Container Overview', () => { cy.get('[data-cy=dataContainerLink]').click(); //Clicking on breadcrumb link. //Is redirected to Data Container page - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); //Go to Config page again diff --git a/cypress/e2e/1_rbac_func.cy.js b/cypress/e2e/1_rbac_func.cy.js index 961ed7dbd..59922676e 100644 --- a/cypress/e2e/1_rbac_func.cy.js +++ b/cypress/e2e/1_rbac_func.cy.js @@ -121,8 +121,8 @@ describe('RBAC Functionality Tests', () => { cy.get('[data-cy=rebalancingSwitch]').should('not.exist'); // rebalancing status } - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=navigationTabs]').should('exist'); cy.contains(/^\d+ Caches$/); cy.contains('Counters'); @@ -223,7 +223,7 @@ describe('RBAC Functionality Tests', () => { function checkNotOwnSecuredCache(cacheName) { //Checking not owned cache to be invisible for the current user. cy.contains('Data container').click(); - cy.get('[id^="pagination-caches-top-pagination"]').first().click(); + cy.get('[id^="pagination-caches-top-toggle"]').first().click(); cy.get('[data-action=per-page-100]').click(); cy.contains('/' + cacheName +'$/').should('not.exist'); } @@ -317,7 +317,7 @@ describe('RBAC Functionality Tests', () => { function checkSchemasPageView(isAdmin) { //Go to schemas and check that no create/edit/delete buttons available cy.contains('Data container').click(); - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Schemas"]').click(); cy.contains('people'); cy.contains('test-6.proto'); cy.get('[data-cy="people.protoConfig"]').click(); @@ -337,7 +337,7 @@ describe('RBAC Functionality Tests', () => { function checkCountersPageView(isSuperAdmin) { //Checking counters page - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('strong-1'); cy.get('body').then(($body) => { if ($body.find('button[aria-label="Show Filters"]').length) { @@ -436,7 +436,7 @@ describe('RBAC Functionality Tests', () => { function checkTasksPage() { //Checking Tasks page - cy.get('a[aria-label="nav-item-Tasks"]').click(); + cy.get('[data-cy="tab-Tasks"]').click(); cy.contains('hello'); } diff --git a/cypress/e2e/3_cache-crud-wizard.cy.js b/cypress/e2e/3_cache-crud-wizard.cy.js index a38967ee9..5212ff80c 100644 --- a/cypress/e2e/3_cache-crud-wizard.cy.js +++ b/cypress/e2e/3_cache-crud-wizard.cy.js @@ -135,8 +135,8 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=wizardNextButton]').click(); // Once the cache created, redirection to main page is done and the cache should be visible - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.contains('asuper-cache'); cy.contains('securedAlias'); @@ -167,8 +167,8 @@ describe('Cache Creation Wizard', () => { cy.contains('Cache ' + cacheName + ' successfully created with e2e-test-template.'); // Once the cache created, redirection to main page is done and the cache should be visible //Is redirected to Data Container page - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.contains(cacheName); deleteCache(cacheName); @@ -195,8 +195,8 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=wizardNextButton]').click(); cy.contains('Cache aSimpleCache created with the provided configuration.'); // Once the cache created, redirection to main page is done and the cache should be visible - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.contains('aSimpleCache'); deleteCache('aSimpleCache'); @@ -229,8 +229,8 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=wizardNextButton]').click(); cy.contains('Cache aSimpleXmlCache created with the provided configuration.'); // Once the cache created, redirection to main page is done and the cache should be visible - cy.get('[data-cy=cluster-manager-header]').should('exist'); - cy.get('[data-cy=cacheManagerStatus]').should('exist'); + cy.get('[data-ouia-component-id=cluster-manager-header-title]').should('exist'); + cy.get('[data-cy="statusInfo-clusterManager"]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.contains('aSimpleXmlCache'); deleteCache('aSimpleXmlCache'); diff --git a/cypress/e2e/3_counters.cy.js b/cypress/e2e/3_counters.cy.js index 9f0c2aa56..6c0797640 100644 --- a/cypress/e2e/3_counters.cy.js +++ b/cypress/e2e/3_counters.cy.js @@ -4,7 +4,7 @@ describe('Counters CRUD', () => { }); it('successfully creates weak & volatile counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); //Creating new weak counter cy.get('button[data-cy="createCounterButton"]').click(); cy.get("[aria-label=counter-name-input]").type("TestWeakVolatileCounter"); @@ -17,7 +17,7 @@ describe('Counters CRUD', () => { }); it('successfully shows error while creating counter with duplicate name', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); //Creating new weak counter cy.get('button[data-cy="createCounterButton"]').click(); cy.get("[aria-label=counter-name-input]").type("TestWeakVolatileCounter"); @@ -30,7 +30,7 @@ describe('Counters CRUD', () => { }); it('successfully creates weak & persistent counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); //Creating new weak counter cy.get('button[data-cy="createCounterButton"]').click(); cy.get("[aria-label=counter-name-input]").type("TestWeakPersistentCounter"); @@ -43,7 +43,7 @@ describe('Counters CRUD', () => { }); it ('successfully creates strong & persistent counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); //Creating new strong counter cy.get('button[data-cy="createCounterButton"]').click(); cy.get("[aria-label=counter-name-input]").type("TestStrongPersistentCounter"); @@ -57,7 +57,7 @@ describe('Counters CRUD', () => { }); it ('successfully creates strong & volatile counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); //Creating new strong counter cy.get('button[data-cy="createCounterButton"]').click(); cy.get("[aria-label=counter-name-input]").type("TestStrongVolatileCounter"); @@ -71,7 +71,7 @@ describe('Counters CRUD', () => { }); it ('successfully adds delta to strong counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('strong-5'); cy.contains('td', 'strong-5').parent() .within($tr => { @@ -93,7 +93,7 @@ describe('Counters CRUD', () => { }); it ('successfully resets strong counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('td', 'strong-5').parent() .within($tr => { cy.get('[data-label="Current value"]').contains('4'); @@ -115,7 +115,7 @@ describe('Counters CRUD', () => { }); it ('successfully deletes weak counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('weak-5'); cy.contains('td', 'weak-5').parent() .within($tr => { @@ -135,7 +135,7 @@ describe('Counters CRUD', () => { }); it ('successfully deletes strong counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('strong-5'); cy.contains('td', 'strong-5').parent() .within($tr => { @@ -154,7 +154,7 @@ describe('Counters CRUD', () => { // it ('successfully filters counters', () => { // // There is an issue in Patternfly with size - // cy.get('a[aria-label="nav-item-Counters"]').click(); + // cy.get('[data-cy="tab-Counters"]').click(); // cy.contains('strong-4'); // cy.contains('weak-4'); // @@ -242,7 +242,7 @@ describe('Counters CRUD', () => { // }); it ('successfully sets value to strong counter', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('strong-4'); cy.contains('td', 'strong-4').parent() .within($tr => { @@ -264,7 +264,7 @@ describe('Counters CRUD', () => { }); it('successully shows error while setting value to strong counter with value out of bounds', () => { - cy.get('a[aria-label="nav-item-Counters"]').click(); + cy.get('[data-cy="tab-Counters"]').click(); cy.contains('TestStrongPersistentCounter'); cy.contains('td', 'TestStrongPersistentCounter').parent() .within($tr => { diff --git a/cypress/e2e/3_proto-schema.cy.js b/cypress/e2e/3_proto-schema.cy.js index e5b0328ac..6d678ab33 100644 --- a/cypress/e2e/3_proto-schema.cy.js +++ b/cypress/e2e/3_proto-schema.cy.js @@ -4,7 +4,7 @@ describe('Proto Schema CRUD', () => { }); it('successfully navigates through schemas', () => { - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Schemas"]').click(); cy.contains('people'); cy.contains('test-6.proto'); cy.contains('test-10.proto'); @@ -46,7 +46,7 @@ describe('Proto Schema CRUD', () => { }); it('successfully creates, edits and deletes a proto schema', () => { - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Schemas"]').click(); //Creating new schema cy.get('button[aria-label="create-schema-button"]').click(); @@ -99,7 +99,7 @@ describe('Proto Schema CRUD', () => { }); it('gives error if duplicate name is used while creating new schema', () => { - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Schemas"]').click(); cy.get('button[aria-label="create-schema-button"]').click(); cy.get('#schema-name').click().type('people'); cy.get('#schema').click().type('schemaValue'); @@ -109,7 +109,7 @@ describe('Proto Schema CRUD', () => { }); it('gives error if special symbols are used in the name field', () => { - cy.get('a[aria-label="nav-item-Schemas"]').click(); + cy.get('[data-cy="tab-Schemas"]').click(); cy.get('button[aria-label="create-schema-button"]').click(); cy.get('#schema-name').click().type('1234567890+-*/name!@#$with%^&*special()_+symbols{}|":isnot?>'); cy.get('#schema').click().type('1234567890+-*/value!@#$with%^&*special()_+symbols{}|":is?>'); diff --git a/src/app/CacheManagers/CacheManagers.tsx b/src/app/CacheManagers/CacheManagers.tsx index ec9a1564d..d62cf6675 100644 --- a/src/app/CacheManagers/CacheManagers.tsx +++ b/src/app/CacheManagers/CacheManagers.tsx @@ -102,6 +102,7 @@ const CacheManagers = () => { <> {tabs.map((tab) => ( { return ( <> - + @@ -176,7 +177,7 @@ const CacheManagers = () => { )} - + {cm.tracing_enabled && (