Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Patternfly 6 #543

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
name: Start 2 Cross-site Infinispan Servers Latest Version
shell: bash
run: |
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
docker run -d -p 11222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigLON.xml:/user-config/e2eTestsConfigLON.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-lon-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigLON.xml"
docker run -d -p 31222:11222 -v ${{ github.workspace }}/scripts/identities.batch:/user-config/identities.batch -v ${{ github.workspace }}/dist:/opt/infinispan/static/console -v ${{ github.workspace }}/scripts/e2eTestsConfigNYC.xml:/user-config/e2eTestsConfigNYC.xml -e JAVA_OPTIONS="-Xms1024m -Xmx3072m -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=2048m -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666" -e IDENTITIES_BATCH="/user-config/identities.batch" quay.io/infinispan-test/server:main --node-name=infinispan-4-nyc-e2e -c "infinispan-xsite.xml" -c "/user-config/e2eTestsConfigNYC.xml"
# Wait for server to startup
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31222/rest/v2/cache-managers/default/health/status > /dev/null
Expand Down
17 changes: 17 additions & 0 deletions __mocks__/keycloak-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// __mocks__/keycloak-js.js

// Mock implementation of the Keycloak class
const Keycloak = jest.fn(() => ({
init: jest.fn().mockResolvedValue(true), // Mocks successful initialization
login: jest.fn().mockResolvedValue(true), // Mocks successful login
logout: jest.fn().mockResolvedValue(true), // Mocks successful logout
authenticated: true, // Mocks that the user is authenticated
accountManagement: jest.fn(), // Mocks account management
token: 'mock-token', // Mocks a token
updateToken: jest.fn().mockResolvedValue(true), // Mocks token refresh
authServerUrl: 'http://mock-server-url', // Mocks the auth server URL
realm: 'mock-realm', // Mocks the realm
}));

// Export the mock class
module.exports = Keycloak;
41 changes: 4 additions & 37 deletions cypress/e2e/1_cluster-welcome.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -44,46 +44,13 @@ describe('Welcome page', () => {
cy.contains('Data container');
cy.contains('Running'); // cluster status

//Checks if navigation menu is hidden
cy.contains('Data Container').should('not.be.visible');
cy.contains('Global Statistics').should('not.be.visible');
cy.contains('Cluster Membership').should('not.be.visible');

cy.get('#nav-toggle').click();
cy.get('[data-cy=sideBarToggle]').click();
//Checks if navigation menu is visible
cy.contains('Data Container').should('be.visible');
cy.contains('Global Statistics').should('be.visible');
cy.contains('Cluster Membership').should('be.visible');

//Clicks the Cluster Membership link and should go to Cluster Membership page
cy.contains('Cluster Membership').click();
cy.contains('Cluster membership').should('be.visible');
cy.contains('Healthy');
cy.contains('infinispan-4-e2e');

//Clicks the Global statistics link and should go to Global statistics page
cy.contains('Global Statistics').click();
cy.contains('Global statistics').should('be.visible');
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');
cy.contains('Running'); // cluster status
cy.contains('Cluster rebalancing on'); // rebalancing status
cy.contains('Access Management').should('be.visible');
cy.contains('Connected Clients').should('be.visible');
});

it('successfully opens and views About page', () => {
Expand Down
65 changes: 17 additions & 48 deletions cypress/e2e/1_data-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('#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');
Expand All @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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('#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
Expand Down
14 changes: 7 additions & 7 deletions cypress/e2e/1_rbac_func.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ describe('RBAC Functionality Tests', () => {
cy.get('[data-cy=rebalancingSwitch]').should('not.exist'); // rebalancing status
}

cy.get('#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');
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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();
Expand All @@ -337,14 +337,14 @@ 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) {
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()
Expand Down Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/2_cache-detail.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,6 @@ describe('Cache Detail Overview', () => {
}

function closePopup() {
cy.get('.pf-v5-c-alert__action > .pf-v5-c-button').click(); //Closing alert popup.
cy.get('[name=close-alert-button]').click(); //Closing alert popup.
}
});
20 changes: 10 additions & 10 deletions cypress/e2e/3_cache-crud-wizard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Cache Creation Wizard', () => {
cy.get('[data-cy=option-typeahead-persistence]').click();
cy.get('[data-cy=menu-toogle-categorySelector]').click();

//Filling alias
//Filling alias
cy.get('[data-cy=menu-toogle-aliasesSelector]').click().type('securedAlias').type('{enter}');

// Next
Expand Down Expand Up @@ -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('#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');
Expand Down Expand Up @@ -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('#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);
Expand All @@ -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('#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');
Expand Down Expand Up @@ -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('#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');
Expand Down Expand Up @@ -258,7 +258,7 @@ describe('Cache Creation Wizard', () => {
cy.get('[data-cy=deleteCacheButton]').click(); //Deleting cache aCache

cy.contains(`Cache ${cacheName} deleted.`);
cy.get('.pf-v5-c-alert__action > .pf-v5-c-button').click(); //Closing alert popup.
cy.get('[name=close-alert-button]').click(); //Closing alert popup.
cy.get(cacheName).should('not.exist'); //Checking that deleted cache is not visible
}
});
6 changes: 3 additions & 3 deletions cypress/e2e/3_client-connection.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ describe('Client connection page', () => {
cy.contains('Client library').should('exist');
cy.contains('Client address').should('exist');
cy.contains('Protocol').should('exist');
cy.contains('infinispan-4-e2e').should('exist');
cy.contains('infinispan-4-lon-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('infinispan-4-lon-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('infinispan-4-lon-e2e').should('exist');
cy.contains('No filtered connected clients').should('not.exist');
});
});
Loading
Loading