diff --git a/cypress.config.ts b/cypress.config.ts index 95932200e..6f7b672b6 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -20,6 +20,6 @@ export default defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'http://localhost:11222/console/', + baseUrl: 'http://localhost:11222/console/' }, }) diff --git a/cypress/e2e/1_acess_management.cy.js b/cypress/e2e/1_acess_management.cy.js index 1b3cec4e5..6792037a0 100644 --- a/cypress/e2e/1_acess_management.cy.js +++ b/cypress/e2e/1_acess_management.cy.js @@ -80,7 +80,12 @@ describe('Global stats', () => { cy.get("[data-cy=option-typeahead-deployer]").click(); cy.get("[data-cy=menu-toogle-roles]").click(); cy.get('[aria-label=Save').click(); - // cy.contains('Access granted to aPrincipal.'); + cy.contains('Access granted to aPrincipal.'); + cy.get('[data-cy=detailLink-admin]').should('not.exist'); + cy.get('[data-cy=detailLink-deployer]').should('exist'); + cy.get('[aria-label^="Close"]').first().click(); +//@TODO uncomment when ISPN-16618 is fixed + //Managing roles of the principal // cy.get("[aria-label=aPrincipal-menu]").click(); // cy.get("[aria-label=manageRoles]").click(); // cy.get("[data-cy=menu-toogle-roles]").click(); @@ -88,8 +93,22 @@ describe('Global stats', () => { // cy.get("[data-cy=option-typeahead-deployer]").click(); // cy.get("[data-cy=menu-toogle-roles]").click(); // cy.get('[aria-label=Save').click(); - // cy.contains('Roles [admin] granted to aPrincipal.'); - // TODO: remove needs to be tested with REST API fixes + // cy.get('[data-cy=detailLink-admin]').should('exist'); + // cy.get('[data-cy=detailLink-deployer]').should('not.exist'); + //@TODO uncomment when the both popups will be shown properly + //cy.contains('Roles [admin] granted to aPrincipal.'); + //cy.contains('Roles [deployer] denied to aPrincipal.'); + + //Removing principal + // cy.get("[aria-label=aPrincipal-menu]").click(); + // cy.get("[aria-label=removePrincipal]").click(); + // cy.get("[data-cy=cancelPrincipalRemoveButton]").click(); + // cy.contains("aPrincipal"); + // cy.get("[aria-label=aPrincipal-menu]").click(); + // cy.get("[aria-label=removePrincipal]").click(); + // cy.get("[data-cy=removePrincipalButton]").click(); + // cy.contains('aPrincipal successfully removed.') + // cy.contains('aPrincipal').should('not.exist'); }); }); diff --git a/cypress/e2e/1_cluster-welcome.cy.js b/cypress/e2e/1_cluster-welcome.cy.js index 444c2c3da..c0de0e546 100644 --- a/cypress/e2e/1_cluster-welcome.cy.js +++ b/cypress/e2e/1_cluster-welcome.cy.js @@ -18,20 +18,24 @@ describe('Welcome page', () => { cy.contains('Running'); // cluster status cy.contains('Cluster rebalancing on'); // rebalancing status cy.contains('Tracing is enabled'); // tracing status - cy.contains('Data container'); cy.contains('15 Caches'); cy.contains('10 Counters'); cy.contains('1 Tasks'); cy.contains('13 Schemas'); cy.contains('invalidationCache'); - //Checks that user's dropbox exists on the page. - cy.contains('admin').click(); - cy.contains('Logout').click(); - cy.get('h1') - .invoke('text') - .should('match', /.* Server.*/); - cy.contains('Open the console'); + if (Cypress.browser.name === 'firefox') { + cy.contains('admin'); + cy.get('[aria-label*="incognito"]').should('exist'); + } else { + //Checks that user's dropbox exists on the page. + cy.contains('admin').click(); + cy.contains('Logout').click(); + cy.get('h1') + .invoke('text') + .should('match', /.* Server.*/); + cy.contains('Open the console'); + } }); it('successfully opens and navigates side menu', () => { @@ -63,6 +67,18 @@ describe('Welcome page', () => { cy.contains('Cluster-wide statistics'); cy.contains('Cache Manager lifecycle values'); + //Clicks the Access management link and should go to Access management page + cy.contains('Access Management').click(); + cy.contains('Access management').should('be.visible'); + cy.contains('Access control'); + cy.contains('Create role'); + + //Clicks the Connected clients link and should go to Connected clients page + cy.contains('Connected Clients').click(); + cy.contains('Connected clients').should('be.visible'); + cy.contains('Client library'); + cy.contains('Server node'); + //Clicks the Data Container link and should go to Data Container page cy.contains('Data Container').click(); cy.contains('Data container').should('be.visible'); diff --git a/cypress/e2e/1_data-container.cy.js b/cypress/e2e/1_data-container.cy.js index b42e1f467..40097e594 100644 --- a/cypress/e2e/1_data-container.cy.js +++ b/cypress/e2e/1_data-container.cy.js @@ -9,6 +9,7 @@ describe('Data Container Overview', () => { it('successfully loads Data Container Overview', () => { cy.contains('Data container'); cy.contains('Running'); // cluster status + cy.contains('Tracing is enabled'); cy.contains('Cluster rebalancing on'); // rebalancing status cy.get('#cluster-manager-header').should('exist'); cy.get('[data-cy=cacheManagerStatus]').should('exist'); diff --git a/cypress/e2e/1_global-stats.cy.js b/cypress/e2e/1_global-stats.cy.js index df4d572d6..4f27b89c6 100644 --- a/cypress/e2e/1_global-stats.cy.js +++ b/cypress/e2e/1_global-stats.cy.js @@ -37,8 +37,25 @@ describe('Global stats', () => { cy.get('[data-cy="clearAccessMetricsButton"]').click(); cy.contains('Permanently clear global metrics?'); cy.get('[data-cy="confirmButton"]').click(); + cy.contains('Global metrics cleared'); cy.get('[data-cy="globalStatsActions"]').click(); - cy.get('[data-cy="refreshAction"]').click(); + + //Comparing the value of the start time before and after refresh to make sure that refresh takes place + cy.get('[data-cy=cacheManagerStartTime]').then(($field) => { + const timeTextBefore = $field.text(); + //Wait for a few seconds before refresh + cy.wait(2000); + + //Refreshing the stat page + cy.get('[data-cy="refreshAction"]').click(); + + cy.get('[data-cy=cacheManagerStartTime]').then(($field) => { + const timeTextAfter = $field.text(); + if (timeTextBefore === timeTextAfter) { + throw new Error("The page was not refreshed properly.") + } + }); + }); }); }); diff --git a/cypress/e2e/1_rbac_func.cy.js b/cypress/e2e/1_rbac_func.cy.js index bb309db68..db576e939 100644 --- a/cypress/e2e/1_rbac_func.cy.js +++ b/cypress/e2e/1_rbac_func.cy.js @@ -35,7 +35,7 @@ describe('RBAC Functionality Tests', () => { checkNonSecuredCacheDetailView(false, false); //Go to tasks (@TODO at the moment for observer no tasks are shown, add after fix) checkSchemasPageView(false); - checkCountersPageView(); + checkCountersPageView(false); cy.login(observerUserName, Cypress.env('password'), '/cache/not-encoded'); checkNoEntriesTabView(false); cy.login(observerUserName, Cypress.env('password'), '/global-stats'); @@ -54,7 +54,7 @@ describe('RBAC Functionality Tests', () => { checkNonSecuredCacheDetailView(false, false); //Go to tasks (@TODO at the moment for observer no tasks are shown, add after fix) checkSchemasPageView(false); - checkCountersPageView(); + checkCountersPageView(false); cy.login(applicationUserName, Cypress.env('password'), '/cache/not-encoded'); checkNoEntriesTabView(false); cy.login(applicationUserName, Cypress.env('password'), '/global-stats'); @@ -73,7 +73,7 @@ describe('RBAC Functionality Tests', () => { checkNonSecuredCacheDetailView(false, false); //Go to tasks (@TODO at the moment for observer no tasks are shown, add after fix) checkSchemasPageView(true); - checkCountersPageView(); + checkCountersPageView(false); cy.login(deployerUserName, Cypress.env('password'), '/cache/not-encoded'); checkNoEntriesTabView(false); cy.login(deployerUserName, Cypress.env('password'), '/global-stats'); @@ -92,7 +92,7 @@ describe('RBAC Functionality Tests', () => { checkNonSecuredCacheDetailView(false, true); //Go to tasks (@TODO at the moment for observer no tasks are shown, add after fix) checkSchemasPageView(true); - checkCountersPageView(); + checkCountersPageView(true); checkTasksPage(); cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/not-encoded'); checkNoEntriesTabView(true); @@ -114,7 +114,7 @@ describe('RBAC Functionality Tests', () => { function checkDataContainerView(isMonitor, isDeployer, isAdmin, isSuperAdmin) { //Checking Data Container view cy.contains('Data container'); // cluster name - cy.contains('Running'); // cluster status + cy.contains('Tracing is enabled'); // Tracing enabled if (isSuperAdmin) { cy.get('[data-cy=rebalancingSwitch]').should('exist'); // rebalancing status } else { @@ -190,6 +190,13 @@ describe('RBAC Functionality Tests', () => { } cy.get('[data-cy=detailCacheActions]').click(); + if(isSuperAdmin) { + cy.get('[data-cy=manageTracingLink]').should('exist'); + } else { + //@TODO uncomment when ISPN-16622 is fixed. + //cy.get('[data-cy=manageTracingLink]').should('not.exist'); + } + cy.get('[data-cy=manageIndexesLink]').click(); if (isSuperAdmin) { cy.get('[data-cy=clearIndexButton]').should('exist'); @@ -328,17 +335,46 @@ describe('RBAC Functionality Tests', () => { } } - function checkCountersPageView() { + function checkCountersPageView(isSuperAdmin) { //Checking counters page cy.get('a[aria-label="nav-item-Counters"]').click(); cy.contains('strong-1'); - // cy.get('#counterFilterSelect').should('exist'); - // cy.contains('td', 'strong-1').parent() - // .within($tr => { - // cy.get('td button').should('exist'); - // cy.get('td button').click(); - // cy.get('[data-cy=deleteCounter]').should('exist'); - // }); + cy.get('body').then(($body) => { + if ($body.find('button[aria-label="Show Filters"]').length) { + cy.get('button[aria-label="Show Filters"]').click(); + } + }) + + cy.get('[data-cy=counterFilterSelectExpanded]').should('exist'); + //Checking delete counter functionality + cy.contains('td', 'strong-1').parent() + .within($tr => { + cy.get('td button').should('exist'); + cy.get('td button').click(); + cy.get('[aria-label="deleteCounter"]').should('exist'); + cy.get('[aria-label="deleteCounter"]').click(); + }); + cy.get('[data-cy="deleteCounterButton"]').should('exist'); + if (isSuperAdmin) { + cy.get('[data-cy="deleteCounterButton"]').should('not.be.disabled'); + } else { + cy.get('[data-cy="deleteCounterButton"]').should('be.disabled'); + } + cy.get('[data-cy="cancelCounterDeleteButton"]').click(); + //Checking edit for counter functionality + cy.contains('td', 'strong-1').parent() + .within($tr => { + cy.get('td button').should('exist'); + cy.get('td button').click(); + cy.get('[aria-label="setCounterAction"]').should('exist'); + cy.get('[aria-label="setCounterAction"]').click(); + }); + cy.get('[data-cy="confirmSetbutton"]').should('exist'); + cy.get('[data-cy="confirmSetbutton"]').should('not.be.disabled'); + cy.get('[data-cy="cancelSetButton"]').click(); + if (isSuperAdmin) { + cy.get('[data-cy="createCounterButton"]').should('exist'); + } } function checkActionsOnSuperCache() { diff --git a/cypress/e2e/2_cache-detail.cy.js b/cypress/e2e/2_cache-detail.cy.js index 34a0cf992..a993e21ab 100644 --- a/cypress/e2e/2_cache-detail.cy.js +++ b/cypress/e2e/2_cache-detail.cy.js @@ -267,6 +267,24 @@ describe('Cache Detail Overview', () => { cy.contains('-2147483647').should('not.exist'); }); + it('successfully switches on/off rebalancing of the cache', () => { + cy.get('#rebalancing-switch').click({force: true}); + cy.contains('Disable rebalancing on this cache?'); + //Testing cancel button + cy.get('[data-cy=rebalanceChangeCancelButton]').click(); + cy.contains('Disable rebalancing on this cache?').should('not.exist'); + //Testing switching off functionality + cy.get('#rebalancing-switch').click({force: true}); + cy.contains('Disable rebalancing on this cache?'); + cy.get('[data-cy=rebalanceChangeButton]').click(); + cy.contains('Rebalancing is off'); + //Testing switching on again + cy.get('#rebalancing-switch').click({force: true}); + cy.contains('Enable rebalancing on this cache?'); + cy.get('[data-cy=rebalanceChangeButton]').click(); + cy.contains('Rebalancing is on'); + }); + function verifyGet(keyType, key, value) { // Going back to cache entries page cy.get('[data-cy=cacheEntriesTab]').click(); diff --git a/cypress/e2e/2_cache-tracing.cy.js b/cypress/e2e/2_cache-tracing.cy.js index e0ed36116..964ae4698 100644 --- a/cypress/e2e/2_cache-tracing.cy.js +++ b/cypress/e2e/2_cache-tracing.cy.js @@ -1,31 +1,36 @@ describe('Cache Tracing', () => { - it('successfully displays tracing and changes options', () => { - cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/people'); - cy.contains('Tracing is enabled'); - - cy.get('[data-cy=detailCacheActions]').click(); - cy.get("[data-cy=manageTracingLink]").click(); - cy.get('[data-cy=tracingSwitch]').should('exist'); - cy.get('[data-cy=tracingSwitch]').uncheck({force: true}); - cy.get('[data-cy=saveButton]').click(); - cy.get('[data-cy=backButton]').click(); - cy.contains('Detail of cache people'); - cy.contains('Tracing is disabled'); - - cy.get('[data-cy=detailCacheActions]').click(); - cy.get("[data-cy=manageTracingLink]").click(); - cy.get('[data-cy=tracingSwitch]').check({force: true}); - cy.contains('Categories'); - cy.contains('container'); - cy.get('[data-cy=menu-toogle-categorySelector]').click(); - cy.get('[data-cy=option-typeahead-x-site]').click(); - cy.get('[data-cy=option-typeahead-cluster]').click(); - cy.get('[data-cy=option-typeahead-persistence]').click(); - cy.get('[data-cy=menu-toogle-categorySelector]').click(); - cy.get('[data-cy=saveButton]').click(); - cy.contains('Cache people successfully updated.'); - cy.get('[data-cy=backButton]').click(); - cy.contains('Detail of cache people'); - cy.contains('Tracing is enabled'); - }); + const cacheNames = ['people', 'indexed-cache']; //non-auth and auth caches + + cacheNames.forEach((cacheName) => { + it('successfully displays tracing and changes options for cache ' + cacheName, () => { + cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/' + cacheName); + cy.contains('Tracing is enabled'); + + cy.get('[data-cy=detailCacheActions]').click(); + cy.get("[data-cy=manageTracingLink]").click(); + cy.get('[data-cy=tracingSwitch]').should('exist'); + cy.get('[data-cy=tracingSwitch]').uncheck({force: true}); + cy.get('[data-cy=saveButton]').click(); + cy.get('[data-cy=backButton]').click(); + cy.contains('Detail of cache ' + cacheName); + cy.contains('Tracing is disabled'); + + cy.get('[data-cy=detailCacheActions]').click(); + cy.get("[data-cy=manageTracingLink]").click(); + cy.get('[data-cy=tracingSwitch]').check({force: true}); + cy.contains('Categories'); + cy.contains('container'); + cy.get('[data-cy=menu-toogle-categorySelector]').click(); + cy.get('[data-cy=option-typeahead-x-site]').click(); + cy.get('[data-cy=option-typeahead-cluster]').click(); + cy.get('[data-cy=option-typeahead-persistence]').click(); + cy.get('[data-cy=menu-toogle-categorySelector]').click(); + cy.get('[data-cy=saveButton]').click(); + cy.contains('Cache ' + cacheName + ' successfully updated.'); + cy.get('[data-cy=backButton]').click(); + cy.contains('Detail of cache ' + cacheName); + cy.contains('Tracing is enabled'); + }); + }) + }); diff --git a/cypress/e2e/2_cluster-membership.cy.js b/cypress/e2e/2_cluster-membership.cy.js index dc70fe6a6..e3e022a02 100644 --- a/cypress/e2e/2_cluster-membership.cy.js +++ b/cypress/e2e/2_cluster-membership.cy.js @@ -5,5 +5,13 @@ describe('Cluster Membership', () => { it('successfully loads Cluster Membership', () => { cy.get('h1').should('contain', 'Cluster membership'); + cy.contains('1 member in use'); + cy.get('[data-cy="downloadReportLink"]').should('exist'); + //@TODO Uncomment and fix this part after ISPN-16672 is fixed + // cy.get('[data-cy="downloadReportLink"]').click(); + // cy.wait(5000); + // let downloadedFile = cy.readFile('./cypress/downloads/downloadedFileName'); + // downloadedFile.should('exist'); + // downloadedFile.its('distributed-cache.mode').should('eq', 'SYNC'); }); }); diff --git a/cypress/e2e/3_cache-aliases.cy.js b/cypress/e2e/3_cache-aliases.cy.js index ba49efdcc..b5ecd28c9 100644 --- a/cypress/e2e/3_cache-aliases.cy.js +++ b/cypress/e2e/3_cache-aliases.cy.js @@ -3,49 +3,53 @@ describe('Data Container Caches', () => { cy.login(Cypress.env('username'), Cypress.env('password')); }); - it('successfully add / update / remove an alias', () => { - cy.get('[data-cy=actions-default]').click(); - cy.get('[aria-label=updateAliasesCacheAction]').click(); - cy.get('[data-cy=updateAliasesCacheModal]').should('exist'); - cy.get('#updateAliasesCacheModal [aria-label=Close]').click(); //Closing modal with close button - cy.get('[data-cy=updateAliasesCacheModal]').should('not.exist'); + const cacheNames = ['default']//, 'indexed-cache']; + + cacheNames.forEach((cacheName) => { + it('successfully add / update / remove an alias for cache ' + cacheName, () => { + cy.get('[data-cy=actions-'+ cacheName + ']').click(); + cy.get('[aria-label=updateAliasesCacheAction]').click(); + cy.get('[data-cy=updateAliasesCacheModal]').should('exist'); + cy.get('#updateAliasesCacheModal [aria-label=Close]').click(); //Closing modal with close button + cy.get('[data-cy=updateAliasesCacheModal]').should('not.exist'); - cy.get('[data-cy=actions-default]').click(); - cy.get('[aria-label=updateAliasesCacheAction]').click(); - cy.get('[data-cy=updateAliasesCacheModal]').should('exist'); - cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button - cy.get('[data-cy=updateAliasesCacheModal]').should('not.exist'); - cy.get('[data-cy=actions-default]').click(); - cy.get('[aria-label=updateAliasesCacheAction]').click(); - // add aliases - cy.get('[data-cy=menu-toogle-aliasesSelector]') - .click().type('alias1') - .type('{enter}'); - cy.get('[data-cy=updateAliasesButton]').click(); //Update aliases - cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button - cy.contains('alias1'); + cy.get('[data-cy=actions-'+ cacheName + ']').click(); + cy.get('[aria-label=updateAliasesCacheAction]').click(); + cy.get('[data-cy=updateAliasesCacheModal]').should('exist'); + cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button + cy.get('[data-cy=updateAliasesCacheModal]').should('not.exist'); + cy.get('[data-cy=actions-'+ cacheName + ']').click(); + cy.get('[aria-label=updateAliasesCacheAction]').click(); + // add aliases + cy.get('[data-cy=menu-toogle-aliasesSelector]') + .click().type('alias1') + .type('{enter}'); + cy.get('[data-cy=updateAliasesButton]').click(); //Update aliases + cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button + cy.contains('alias1'); - // Check detail has aliases - cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/default'); - cy.contains('Aliases'); - cy.contains('alias1'); - cy.login(Cypress.env('username'), Cypress.env('password')); + // Check detail has aliases + cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/' + cacheName); + cy.contains('Aliases'); + cy.contains('alias1'); + cy.login(Cypress.env('username'), Cypress.env('password')); - cy.get('[data-cy=actions-default]').click(); - cy.get('[aria-label=updateAliasesCacheAction]').click(); - // add aliases - cy.get('[data-cy=menu-toogle-aliasesSelector]') - .click().type('alias1') - .type('{enter}'); - cy.get('[data-cy=updateAliasesButton]').click(); //Update aliases - cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button - cy.contains('alias1').should('not.exist'); - cy.contains('Success alert:Cache default successfully updated.'); + cy.get('[data-cy=actions-'+ cacheName + ']').click(); + cy.get('[aria-label=updateAliasesCacheAction]').click(); + // add aliases + cy.get('[data-cy=menu-toogle-aliasesSelector]') + .click().type('alias1') + .type('{enter}'); + cy.get('[data-cy=updateAliasesButton]').click(); //Update aliases + cy.get('[data-cy=closeAction]').click(); //Closing modal with Close button + cy.contains('alias1').should('not.exist'); + cy.contains('Success alert:Cache ' + cacheName + ' successfully updated.'); - // Check detail has aliases - cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/default'); - cy.contains('Aliases').should('not.exist'); - cy.contains('alias1').should('not.exist'); - cy.login(Cypress.env('username'), Cypress.env('password')); + // Check detail has aliases + cy.login(Cypress.env('username'), Cypress.env('password'), '/cache/' + cacheName); + cy.contains('Aliases').should('not.exist'); + cy.contains('alias1').should('not.exist'); + cy.login(Cypress.env('username'), Cypress.env('password')); + }); }); }); diff --git a/cypress/e2e/3_cache-crud-wizard.cy.js b/cypress/e2e/3_cache-crud-wizard.cy.js index d11a2b985..2e7930274 100644 --- a/cypress/e2e/3_cache-crud-wizard.cy.js +++ b/cypress/e2e/3_cache-crud-wizard.cy.js @@ -105,6 +105,9 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=option-typeahead-persistence]').click(); cy.get('[data-cy=menu-toogle-categorySelector]').click(); + //Filling alias + cy.get('[data-cy=menu-toogle-aliasesSelector]').click().type('securedAlias').type('{enter}'); + // Next cy.get('[data-cy=wizardNextButton]').click(); @@ -136,6 +139,7 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=cacheManagerStatus]').should('exist'); cy.get('[data-cy=rebalancingSwitch]').should('exist'); cy.contains('asuper-cache'); + cy.contains('securedAlias'); cy.get('[data-cy=feature-asuper-cache]').contains('Bounded'); cy.get('[data-cy=feature-asuper-cache]').contains('Indexed'); cy.get('[data-cy=feature-asuper-cache]').contains('Secured'); @@ -179,10 +183,14 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=wizardNextButton]').click(); cy.get('[data-cy=provideConfigArea] > button').click(); - cy.get('.pf-v5-c-code-editor__code textarea:first').click({force: true}).focused().type( '{downArrow}' ) - .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") - .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") - .type("{shift}{end}").type("{del}{del}").type("{enter}{upArrow}").type('"distributed-cache": {{}"mode": "ASYNC", "statistics": true }{del}'); + if (Cypress.browser.name === "firefox") { + //At the moment do nothing as the proper command for editing the config is not found yet + } else { + cy.get('.pf-v5-c-code-editor__code textarea:first').click({force: true}).focused().type( '{downArrow}' ) + .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") + .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") + .type("{shift}{end}").type("{del}{del}").type("{enter}{upArrow}").type('"distributed-cache": {{}"mode": "ASYNC", "statistics": true }{del}'); + } cy.get('[data-cy=wizardNextButton]').click(); cy.contains('Cache aSimpleCache created with the provided configuration.'); @@ -203,17 +211,21 @@ describe('Cache Creation Wizard', () => { cy.get('[data-cy=wizardNextButton]').click(); cy.get('[data-cy=provideConfigArea] > button').click(); - cy.get('.pf-v5-c-code-editor__code textarea:first').click({force: true}).focused().type( '{downArrow}' ) - .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") - .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") - .type("{shift}{end}").type("{del}{del}").type("{enter}{upArrow}") - .type( - '\ - \ - \ - ', - { parseSpecialCharSequences: false } - ).type("{del}{del}").type("{upArrow}{backspace}"); + if (Cypress.browser.name === "firefox") { + //At the moment do nothing as the proper command for editing the config is not found yet + } else { + cy.get('.pf-v5-c-code-editor__code textarea:first').click({force: true}).focused().type( '{downArrow}' ) + .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") + .type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}").type("{shift}{end}").type("{del}{del}") + .type("{shift}{end}").type("{del}{del}").type("{enter}{upArrow}") + .type( + '\ + \ + \ + ', + { parseSpecialCharSequences: false } + ).type("{del}{del}").type("{upArrow}{backspace}"); + } 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 diff --git a/cypress/e2e/3_client-connection.cy.js b/cypress/e2e/3_client-connection.cy.js index 1af65e79d..bb8845ee2 100644 --- a/cypress/e2e/3_client-connection.cy.js +++ b/cypress/e2e/3_client-connection.cy.js @@ -13,4 +13,16 @@ describe('Client connection page', () => { cy.contains('Protocol').should('exist'); cy.contains('infinispan-4-e2e').should('exist'); }); + + it('successfully filters and refreshes the page', () => { + cy.get('[aria-label="Search input"]').type('test'); + cy.contains('infinispan-4-e2e').should('not.exist'); + cy.contains('No filtered connected clients').should('exist'); + //Refreshing the page + cy.get('[data-cy=aclActions]').click(); + cy.get('[data-cy=refreshAction]').click(); + //Check that page is refreshed properly + cy.contains('infinispan-4-e2e').should('exist'); + cy.contains('No filtered connected clients').should('not.exist'); + }); }); diff --git a/cypress/e2e/3_proto-schema.cy.js b/cypress/e2e/3_proto-schema.cy.js index ffeef53b5..e5b0328ac 100644 --- a/cypress/e2e/3_proto-schema.cy.js +++ b/cypress/e2e/3_proto-schema.cy.js @@ -64,18 +64,24 @@ describe('Proto Schema CRUD', () => { cy.get('[aria-label="editSchemaAction"]').click(); cy.contains('schemaValue'); cy.contains('Save'); + //Artificially adding here some delays between actions so that the proto schema is updated properly and normally shown on the page. + cy.wait(3000); cy.get('[data-cy=schemaEditArea]').type('{selectall}', { timeout: 10000 }); + cy.wait(3000); cy.get('[data-cy=schemaEditArea]').type( 'package org.infinispan; message ExampleProto { optional int32 other_id = 1; }', { parseSpecialCharSequences: false } ); + cy.wait(3000); cy.get('button[aria-label="confirm-edit-schema-button"]').click(); + cy.wait(3000); cy.contains('Schema ' + schemaName +'.proto updated.'); + cy.wait(3000); cy.get('.pf-v5-c-alert__action > .pf-v5-c-button').click(); //Closing alert popup. //Waiting 5 seconds so that the proto schema is managed to be updated on the page. - cy.wait(5000); + cy.wait(3000); cy.get('[data-cy="' + schemaName + '.protoConfig"]').click(); - + cy.wait(3000); cy.contains('schemaValue').should('not.exist'); cy.contains('ExampleProto'); cy.contains('Schema ' + schemaName + '.proto has errors').should('not.exist'); diff --git a/src/app/AccessManagement/RemovePrincipal.tsx b/src/app/AccessManagement/RemovePrincipal.tsx index bd88f207c..70676770c 100644 --- a/src/app/AccessManagement/RemovePrincipal.tsx +++ b/src/app/AccessManagement/RemovePrincipal.tsx @@ -29,6 +29,7 @@ const RemovePrincipal = (props: { { onRemove(); diff --git a/src/app/ClusterStatus/ClusterStatus.tsx b/src/app/ClusterStatus/ClusterStatus.tsx index 0c31e65f9..fd9f2be73 100644 --- a/src/app/ClusterStatus/ClusterStatus.tsx +++ b/src/app/ClusterStatus/ClusterStatus.tsx @@ -223,6 +223,7 @@ const ClusterStatus = () => { {row.physical_address} { - + {displayUtils.formatNumber(stats.time_since_start)}