diff --git a/src/hooks/useAvailableNamespaces.ts b/src/hooks/useAvailableNamespaces.ts index 288426131f..117e4803ea 100644 --- a/src/hooks/useAvailableNamespaces.ts +++ b/src/hooks/useAvailableNamespaces.ts @@ -37,7 +37,10 @@ export function useAvailableNamespaces() { if (showHiddenNamespaces) return true; return !hiddenNamespaces.includes(n); }); - if (filteredNamespaces) { + if ( + filteredNamespaces && + JSON.stringify(filteredNamespaces) !== JSON.stringify(namespaces) + ) { setNamespaces(filteredNamespaces); } }, [ @@ -46,6 +49,7 @@ export function useAvailableNamespaces() { hiddenNamespaces, setNamespaces, showHiddenNamespaces, + namespaces, ]); return { namespaces, refetch, silentRefetch, setNamespaces }; diff --git a/tests/integration/support/commands.js b/tests/integration/support/commands.js index 04b0410e65..2952ea1a1d 100644 --- a/tests/integration/support/commands.js +++ b/tests/integration/support/commands.js @@ -43,14 +43,14 @@ Cypress.Commands.add( Cypress.Commands.add('checkItemOnGenericListLink', resourceName => { cy.get('ui5-table-row') .find('ui5-table-cell') - .contains('span', resourceName) + .contains('ui5-text', resourceName) .should('be.visible'); }); Cypress.Commands.add('clickGenericListLink', resourceName => { cy.get('ui5-table-row') .find('ui5-table-cell') - .contains('span', resourceName) + .contains('ui5-text', resourceName) .click(); }); @@ -177,8 +177,8 @@ Cypress.Commands.add( cy.wait(1000); if (selectSearchResult) { - cy.get('ui5-li-suggestion-item:visible') - .contains(resourceName) + cy.get('ui5-suggestion-item:visible') + .contains('li', resourceName) .click(); } @@ -233,7 +233,7 @@ Cypress.Commands.add( cy.get('ui5-table-row') .find('ui5-table-cell') - .contains('span', resourceName) + .contains('ui5-text', resourceName) .should('not.be.visible'); cy.getMidColumn() diff --git a/tests/integration/support/inspect-list.js b/tests/integration/support/inspect-list.js index d93e116688..5cb3d7a890 100644 --- a/tests/integration/support/inspect-list.js +++ b/tests/integration/support/inspect-list.js @@ -6,5 +6,5 @@ Cypress.Commands.add('inspectList', (resourceName, hiddenButtons = false) => { .wait(1000) .type(`${resourceName}{enter}`); - cy.contains('span', resourceName).should('be.visible'); + cy.contains('ui5-text', resourceName).should('be.visible'); }); diff --git a/tests/integration/tests/cluster/test-cluster-configuration.spec.js b/tests/integration/tests/cluster/test-cluster-configuration.spec.js index 8b74b75f6c..b8e148fba6 100644 --- a/tests/integration/tests/cluster/test-cluster-configuration.spec.js +++ b/tests/integration/tests/cluster/test-cluster-configuration.spec.js @@ -65,7 +65,7 @@ context('Test Cluster configuration', () => { cy.get('[title="Profile"]').click(); - cy.get('ui5-menu-li:visible') + cy.get('ui5-menu-item:visible') .contains('Preferences') .click({ force: true }); @@ -77,7 +77,7 @@ context('Test Cluster configuration', () => { .contains('20') .click(); - cy.get('ui5-list:visible') + cy.get('ui5-option:visible') .contains('10') .click(); diff --git a/tests/integration/tests/cluster/test-cluster-overview.spec.js b/tests/integration/tests/cluster/test-cluster-overview.spec.js index ce3efbf2f8..d35ffb90ee 100644 --- a/tests/integration/tests/cluster/test-cluster-overview.spec.js +++ b/tests/integration/tests/cluster/test-cluster-overview.spec.js @@ -52,7 +52,7 @@ context('Test Cluster Overview', () => { .get('.radial-chart') .contains('text.progress-label', '50%') .get('.radial-chart') - .contains('span.additional-info', 'test1233456'); + .contains('ui5-text.additional-info', 'test1233456'); // test injected statistical card exists and works cy.contains( @@ -93,13 +93,17 @@ context('Test Cluster Overview', () => { cy.loginAndSelectCluster(); - cy.get('[name="feedback"]').should('exist'); + cy.get('ui5-shellbar') + .find('[name="feedback"]') + .should('exist'); cy.setBusolaFeature('FEEDBACK', false); cy.loginAndSelectCluster(); - cy.get('[name="feedback"]').should('not.exist'); + cy.get('ui5-shellbar') + .find('[name="feedback"]') + .should('not.exist'); }); it('Go to Node details', () => { diff --git a/tests/integration/tests/cluster/test-cluster-role-bindings.spec.js b/tests/integration/tests/cluster/test-cluster-role-bindings.spec.js index e61cb35aee..261125961d 100644 --- a/tests/integration/tests/cluster/test-cluster-role-bindings.spec.js +++ b/tests/integration/tests/cluster/test-cluster-role-bindings.spec.js @@ -71,7 +71,7 @@ context('Test Cluster Role Bindings', () => { cy.contains('[role="combobox"]', 'User').click(); - cy.get('ui5-li:visible') + cy.get('ui5-option:visible') .contains('ServiceAccount') .find('li') .click({ force: true }); @@ -96,6 +96,7 @@ context('Test Cluster Role Bindings', () => { cy.inspectTab('View'); cy.getMidColumn() + .find('ui5-table-cell') .contains('Group') .should('be.visible'); diff --git a/tests/integration/tests/cluster/test-dashboard-version.spec.js b/tests/integration/tests/cluster/test-dashboard-version.spec.js index 2b64b0da8d..4426e09b76 100644 --- a/tests/integration/tests/cluster/test-dashboard-version.spec.js +++ b/tests/integration/tests/cluster/test-dashboard-version.spec.js @@ -10,8 +10,8 @@ context('Test Kyma Dashboard Version link', () => { it('Check Kyma Dashboard Version link', () => { cy.get('[title="Profile"]').click(); - cy.get('.ui5-menu-rp') - .find('ui5-menu-li:visible') + cy.get('ui5-menu') + .find('ui5-menu-item:visible') .contains('Legal Information') .click({ force: true }); diff --git a/tests/integration/tests/cluster/test-multiple-context-kubeconfig.spec.js b/tests/integration/tests/cluster/test-multiple-context-kubeconfig.spec.js index 59c7598eae..97dbcabe21 100644 --- a/tests/integration/tests/cluster/test-multiple-context-kubeconfig.spec.js +++ b/tests/integration/tests/cluster/test-multiple-context-kubeconfig.spec.js @@ -64,21 +64,27 @@ context('Test multiple context kubeconfig', () => { .contains(kubeconfig['current-context']) .click(); - cy.get('ui5-li:visible').contains(kubeconfig.contexts[1].name); + cy.get('ui5-option:visible').contains(kubeconfig.contexts[1].name); - cy.get('ui5-li:visible') + cy.wait(3000); + + cy.get('ui5-option:visible') .contains('All contexts') .click(); + cy.wait(3000); cy.contains('Next').click({ force: true }); + cy.wait(3000); cy.get('ui5-button:visible') .contains('Next step') .click(); + cy.wait(3000); cy.get(`[accessible-name="last-step"]:visible`) .contains('Connect cluster') .click({ force: true }); + cy.wait(3000); cy.contains('Cluster Details').should('exist'); diff --git a/tests/integration/tests/cluster/test-navigation-features.spec.js b/tests/integration/tests/cluster/test-navigation-features.spec.js index 2c869ba928..cd0a2c276b 100644 --- a/tests/integration/tests/cluster/test-navigation-features.spec.js +++ b/tests/integration/tests/cluster/test-navigation-features.spec.js @@ -36,12 +36,12 @@ context('Test navigation features', () => { .wait(1000) .type('cronjob-controller'); - cy.get('ui5-li-suggestion-item:visible') - .contains('cronjob-controller') + cy.get('ui5-suggestion-item:visible') + .contains('li', /cronjob-controller/) .click(); - cy.contains('cronjob-controller (SA)') // link wrapper - .contains('cronjob-controller') // link itself + cy.contains('ui5-table-cell', 'cronjob-controller (SA)') + .find('ui5-link') // link itself .click(); cy.contains('disabled').should('exist'); diff --git a/tests/integration/tests/namespace/a-run-before.spec.js b/tests/integration/tests/namespace/a-run-before.spec.js index 0a299bf1b3..64ac992939 100644 --- a/tests/integration/tests/namespace/a-run-before.spec.js +++ b/tests/integration/tests/namespace/a-run-before.spec.js @@ -27,10 +27,9 @@ context('Create Namespace', () => { .find('ui5-icon[accessible-name="Select Options"]') .click(); - cy.get('ui5-static-area') + cy.get('ui5-responsive-popover') .find('ui5-li:visible') .contains('XL (limits: 9Gi, requests: 8.4Gi)') - .find('li[role="listitem"]') .click({ force: true }); cy.get('.create-form') diff --git a/tests/integration/tests/namespace/test-resource-validation.spec.js b/tests/integration/tests/namespace/test-resource-validation.spec.js index 2f166a0cce..14b5ce7344 100644 --- a/tests/integration/tests/namespace/test-resource-validation.spec.js +++ b/tests/integration/tests/namespace/test-resource-validation.spec.js @@ -41,7 +41,7 @@ context('Test resource validation', () => { it('Disables resource validation via preferences', () => { cy.get('[title="Profile"]').click(); - cy.get('ui5-menu-li:visible') + cy.get('ui5-menu-item:visible') .contains('Preferences') .click({ force: true }); @@ -80,7 +80,7 @@ context('Test resource validation', () => { it('Customize resource validation policies via preferences', () => { cy.get('[title="Profile"]').click(); - cy.get('ui5-menu-li:visible') + cy.get('ui5-menu-item:visible') .contains('Preferences') .click({ force: true }); @@ -136,7 +136,7 @@ context('Test resource validation', () => { cy.get('[title="Profile"]').click(); - cy.get('ui5-menu-li:visible') + cy.get('ui5-menu-item:visible') .contains('Preferences') .click({ force: true });