Skip to content

Commit

Permalink
Fixing tests after ISPN-14718 is implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
andyuk1986 authored and dpanshug committed Jun 5, 2023
1 parent 7c6b701 commit 1737340
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/cluster-welcome.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Welcome page', () => {
cy.contains('Default'); // cluster name
cy.contains('Running'); // cluster status
cy.contains('Cluster rebalancing on'); // rebalancing status
cy.contains('20 Caches');
cy.contains('19 Caches');
cy.contains('10 Counters');
cy.contains('1 Tasks');
cy.contains('13 Schemas');
Expand Down
16 changes: 6 additions & 10 deletions cypress/e2e/data-container.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Data Container Overview', () => {
const numberOfCaches = 20;
const numberOfCaches = 19;

beforeEach(() => {
cy.login(Cypress.env('username'), Cypress.env('password'));
Expand Down Expand Up @@ -175,25 +175,22 @@ describe('Data Container Overview', () => {
cy.get('[data-cy=cacheFilterSelect]').click(); //Closing filter selectbox

//Verifying that only distributed caches are shown
cy.contains('1 - 10 of 15');
cy.contains('1 - 10 of 14');
cy.contains('java-serialized-cache');
cy.contains('text-cache').should('not.exist');
cy.get('[data-cy=cachesTable] tr').should('have.length', 11); //11 including header row
//Navigating to the next page to see the rest of the caches
cy.get('[data-action=next]').click();
cy.get('[data-cy=cachesTable] tr').should('have.length', 6); //6 including header row
cy.get('[data-cy=cachesTable] tr').should('have.length', 5); //5 including header row
cy.contains('xml-cache');
cy.contains('text-cache');
cy.contains('java-serialized-cache').should('not.exist');

//Changing the number of caches on the page to view them all
cy.get('[id^="pagination-caches-top-pagination"]').click();
cy.get('[data-action=per-page-20]').click();
cy.contains('not-encoded');
cy.contains('xml-cache');
cy.contains('text-cache');
cy.contains('1 - 15 of 15');
cy.get('[data-cy=cachesTable] tr').should('have.length', 16); //16 including header row
cy.contains('1 - 14 of 14');
cy.get('[data-cy=cachesTable] tr').should('have.length', 15); //15 including header row

//Verifying that all entries are distributed caches
cy.get('[data-cy^=type-]').each((badge) => {
Expand Down Expand Up @@ -276,13 +273,12 @@ describe('Data Container Overview', () => {
cy.get('[data-cy=cacheFilterSelectExpanded]').should('exist');
cy.get('[id$="Authorization"]').click(); //Filtering secured caches
cy.get('[data-cy=cacheFilterSelect]').click(); //Closing filter selectbox
cy.get('[data-cy=cachesTable] tr').should('have.length', 4); //4 including header row - nothing is changed
cy.get('[data-cy=cachesTable] tr').should('have.length', 3); //3 including header row - nothing is changed
cy.get('[data-cy^=feature-]').each((badge) => {
cy.wrap(badge).contains(/Secured/);
});
cy.contains('indexed-cache');
cy.contains('super-cache');
cy.contains('text-cache');

//Clearing all filters and setting Persistence
cy.get('[data-cy=clearAllButton]').click();
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/rbac_func.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ describe('RBAC Functionlity Tests', () => {
cy.get('#cluster-manager-header').should('exist');
cy.get('[data-cy=cacheManagerStatus]').should('exist');
cy.get('[data-cy=navigationTabs]').should('exist');
cy.contains('19 Caches');
cy.contains(/^\d+ Caches$/);

cy.contains('10 Counters');
if (isMonitor) {
cy.contains('1 Tasks').should('not.exist');
Expand Down Expand Up @@ -179,11 +180,11 @@ describe('RBAC Functionlity Tests', () => {
}

function checkNotOwnSecuredCache(cacheName) {
//Checking super cache to be disabled for observer/monitor
//Checking not owned cache to be invisible for the current user.
cy.contains('Data container').click();
cy.get('[id^="pagination-caches-top-pagination"]').click();
cy.get('[data-action=per-page-100]').click();
cy.get('[data-cy=detailButton-' + cacheName + ']').should('be.disabled');
cy.contains(/cacheName$/).should('not.exist');
}

function checkNonSecuredCacheDetailView(isMonitor, isSuperAdmin) {
Expand Down

0 comments on commit 1737340

Please sign in to comment.