You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2026/04/02 14:27:15 UTC

(streampipes) branch dev updated: test: stabilize dataset role chart flow (#4347)

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3fe3742092 test: stabilize dataset role chart flow (#4347)
3fe3742092 is described below

commit 3fe374209252814424c97d3287b003a44c692114
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Thu Apr 2 16:27:08 2026 +0200

    test: stabilize dataset role chart flow (#4347)
---
 ui/cypress/AGENTS.md                                        | 9 +++++++++
 ui/cypress/support/utils/chart/ChartBtns.ts                 | 4 ++++
 ui/cypress/tests/userManagement/testUserRoleDataset.spec.ts | 5 ++++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/ui/cypress/AGENTS.md b/ui/cypress/AGENTS.md
index ed5bcf3e87..1ebc9989ed 100644
--- a/ui/cypress/AGENTS.md
+++ b/ui/cypress/AGENTS.md
@@ -27,6 +27,8 @@ Keep tests readable and maintainable by centralizing selectors and common flows
 - For dynamic selectors, use typed helper methods with parameters instead of string concatenation in specs.
 - Reuse existing selector constants/patterns when already present (for example `SiteUtils` constants).
 - Keep direct `cy.get(...)` in specs to a minimum; if reused, move it behind a support helper.
+- Do not probe UI state via `cy.get('body')`/`$body.find(...)` conditional patterns.
+- If a reliable element is hard to target, add a dedicated `data-cy` in the Angular template and expose it through the matching `*Btns` helper.
 
 ## Spec Structure
 
@@ -35,6 +37,13 @@ Keep tests readable and maintainable by centralizing selectors and common flows
 - Avoid fixed `cy.wait(...)` where possible; prefer state-based waits/assertions via helpers.
 - Keep each test independent: no inter-test dependencies.
 
+## Interaction Style For E2E Steps
+
+- Prefer simple, deterministic Cypress steps that mirror user flows.
+- Prefer explicit navigation/toolbar actions to leave pages in a clean state instead of conditional dialog handling.
+- Avoid `force: true` clicks unless there is no feasible deterministic interaction path.
+- When overlays/dialogs block interaction repeatedly, fix selectors/flow with stable `data-cy` hooks in UI code rather than adding DOM-probing workarounds in specs.
+
 ## Refactoring Expectations
 
 - When touching an existing spec with many inline selectors, opportunistically move touched selectors to the matching `*Btns`/`*Utils` class.
diff --git a/ui/cypress/support/utils/chart/ChartBtns.ts b/ui/cypress/support/utils/chart/ChartBtns.ts
index 7d40866f2a..1d7df66aa4 100644
--- a/ui/cypress/support/utils/chart/ChartBtns.ts
+++ b/ui/cypress/support/utils/chart/ChartBtns.ts
@@ -126,6 +126,10 @@ export class ChartBtns {
         return cy.dataCy('save-data-explorer-go-back-to-overview');
     }
 
+    public static discardDataExplorerWidgetBtn() {
+        return cy.dataCy('discard-data-explorer-widget-btn');
+    }
+
     public static chartDataPreview() {
         return cy.dataCy('chart-data-preview');
     }
diff --git a/ui/cypress/tests/userManagement/testUserRoleDataset.spec.ts b/ui/cypress/tests/userManagement/testUserRoleDataset.spec.ts
index b1ad06104a..6d8cc5b882 100644
--- a/ui/cypress/tests/userManagement/testUserRoleDataset.spec.ts
+++ b/ui/cypress/tests/userManagement/testUserRoleDataset.spec.ts
@@ -170,8 +170,11 @@ describe('Test Dataset Permissions', () => {
         ChartBtns.openNewDataViewBtn().click();
         if (!available) {
             cy.get('sp-alert-banner').should('be.visible');
+            ChartBtns.discardDataExplorerWidgetBtn().click();
         } else {
-            ChartUtils.assertSelectDataSet(datasetName);
+            cy.dataCy('data-explorer-select-data-set').click();
+            cy.get('mat-option').contains(datasetName).click();
+            ChartBtns.discardDataExplorerWidgetBtn().click();
             ChartUtils.addDataViewAndTableWidget('test', datasetName, true);
             ChartUtils.saveDataViewConfiguration();
         }