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 2021/11/15 16:20:13 UTC

[incubator-streampipes] 02/03: [hotfix] Add e2e test for a data explorer admin user

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/incubator-streampipes.git

commit 619750139b3c10416b20497185a9ac9149f40b51
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Mon Nov 15 17:14:25 2021 +0100

    [hotfix] Add e2e test for a data explorer admin user
---
 ui/cypress/support/general/switchUser.ts                       |  2 +-
 .../userManagement/{userManagement.ts => addUserAdmin.ts}      |  0
 .../{userManagement.ts => addUserDataExplorerAdmin.ts}         |  6 ++++--
 ui/src/app/core/components/iconbar/iconbar.component.html      | 10 +++++++---
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ui/cypress/support/general/switchUser.ts b/ui/cypress/support/general/switchUser.ts
index af66852..bf6cfee 100644
--- a/ui/cypress/support/general/switchUser.ts
+++ b/ui/cypress/support/general/switchUser.ts
@@ -36,5 +36,5 @@ export const switchUser = (user: User) => {
   cy.dataCy('login-email').type(user.email);
   cy.dataCy('login-password').type(user.password);
   cy.dataCy('login-button').click();
-  cy.wait(5000);
+  cy.wait(1000);
 };
diff --git a/ui/cypress/tests/userManagement/userManagement.ts b/ui/cypress/tests/userManagement/addUserAdmin.ts
similarity index 100%
copy from ui/cypress/tests/userManagement/userManagement.ts
copy to ui/cypress/tests/userManagement/addUserAdmin.ts
diff --git a/ui/cypress/tests/userManagement/userManagement.ts b/ui/cypress/tests/userManagement/addUserDataExplorerAdmin.ts
similarity index 89%
rename from ui/cypress/tests/userManagement/userManagement.ts
rename to ui/cypress/tests/userManagement/addUserDataExplorerAdmin.ts
index 8a277c5..37633cf 100644
--- a/ui/cypress/tests/userManagement/userManagement.ts
+++ b/ui/cypress/tests/userManagement/addUserDataExplorerAdmin.ts
@@ -29,6 +29,7 @@ describe('Test User Management', () => {
   it('Perform Test', () => {
     // Add new user
     UserUtils.goToUserConfiguration();
+    cy.dataCy('navigation-icon', { timeout: 10000 }).should('have.length', 11);
 
     cy.dataCy('user-accounts-table-row', { timeout: 10000 }).should('have.length', 1);
 
@@ -37,7 +38,7 @@ describe('Test User Management', () => {
     const user = UserBuilder.create(email)
         .setName(name)
         .setPassword(name)
-        .addRole(UserRole.ROLE_ADMIN)
+        .addRole(UserRole.ROLE_DATA_EXPLORER_ADMIN)
         .build();
 
     UserUtils.addUser(user);
@@ -47,11 +48,12 @@ describe('Test User Management', () => {
     // Login as user
     cy.switchUser(user);
 
-    UserUtils.goToUserConfiguration();
+    cy.dataCy('navigation-icon', { timeout: 10000 }).should('have.length', 2);
 
     cy.switchUser(UserUtils.adminUser);
     UserUtils.goToUserConfiguration();
     UserUtils.deleteUser(user);
+
     // Validate that user is removed
     cy.dataCy('user-accounts-table-row', { timeout: 10000 }).should('have.length', 1);
   });
diff --git a/ui/src/app/core/components/iconbar/iconbar.component.html b/ui/src/app/core/components/iconbar/iconbar.component.html
index bdeb23f..b975f72 100644
--- a/ui/src/app/core/components/iconbar/iconbar.component.html
+++ b/ui/src/app/core/components/iconbar/iconbar.component.html
@@ -21,7 +21,8 @@
         <div *ngIf="item.visible" style="min-width:0px;padding:0px;padding-top:5px;padding-bottom:5px;" [ngClass]="item.link === activePage ? 'sp-navbar-item-selected': 'sp-navbar-item'">
         <button mat-button mat-icon-button class="button-margin-iconbar iconbar-size" (click)="go(item.link)"
                 matTooltip="{{item.title}}" matTooltipPosition="right" >
-            <mat-icon [ngClass]="item.link === activePage ? 'sp-navbar-icon-selected' : 'sp-navbar-icon'">
+            <mat-icon [ngClass]="item.link === activePage ? 'sp-navbar-icon-selected' : 'sp-navbar-icon'"
+                      data-cy="navigation-icon">
                 {{item.icon}}
             </mat-icon>
         </button>
@@ -34,7 +35,9 @@
                 matTooltip="Notifications" matTooltipPosition="right">
             <mat-icon [matBadge]="notificationCountService.unreadNotificationCount"
                       [matBadgeHidden]="notificationCountService.unreadNotificationCount == 0"
-                      [ngClass]="'notifications' === activePage ?'sp-navbar-icon-selected' : 'sp-navbar-icon'">chat
+                      [ngClass]="'notifications' === activePage ?'sp-navbar-icon-selected' : 'sp-navbar-icon'"
+                      data-cy="navigation-icon">chat
+
             </mat-icon>
         </button>
     </div>
@@ -47,7 +50,8 @@
                     (click)="go(item.link)"
                     matTooltip="{{item.title}}" >
                 <mat-icon
-                        [ngClass]="item.link === activePage ?'sp-navbar-icon-selected' : 'sp-navbar-icon'">{{item.icon}}</mat-icon>
+                        [ngClass]="item.link === activePage ?'sp-navbar-icon-selected' : 'sp-navbar-icon'"
+                        data-cy="navigation-icon">{{item.icon}}</mat-icon>
             </button>
         </div>
     </div>