You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2024/08/29 11:19:17 UTC

(streampipes) branch fix-various-cypress-tests created (now cac0af2d0f)

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

riemer pushed a change to branch fix-various-cypress-tests
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at cac0af2d0f fix: Various cypress tests

This branch includes the following new commits:

     new cac0af2d0f fix: Various cypress tests

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(streampipes) 01/01: fix: Various cypress tests

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch fix-various-cypress-tests
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit cac0af2d0f5a4266373c83fd8153a4049d7653fc
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Thu Aug 29 13:19:01 2024 +0200

    fix: Various cypress tests
---
 .../support/utils/configuration/SiteUtils.ts       |  8 ++-
 ui/cypress/support/utils/connect/ConnectUtils.ts   |  6 +++
 .../tests/assetManagement/createAsset.spec.ts      | 61 +---------------------
 .../tests/connect/allAdapterActions.smoke.spec.ts  |  2 +-
 .../connect/createAdapterWithoutStarting.spec.ts   |  4 +-
 .../create-asset-dialog.component.html             |  2 +-
 .../live-preview-table.component.html              |  1 +
 7 files changed, 17 insertions(+), 67 deletions(-)

diff --git a/ui/cypress/support/utils/configuration/SiteUtils.ts b/ui/cypress/support/utils/configuration/SiteUtils.ts
index 59bbf0900e..60252bbda3 100644
--- a/ui/cypress/support/utils/configuration/SiteUtils.ts
+++ b/ui/cypress/support/utils/configuration/SiteUtils.ts
@@ -38,8 +38,12 @@ export class SiteUtils {
     public static LABEL_TABLE_AREA = 'site-table-row-areas';
 
     public static enableGeoFeatures(tileServerUrl: string): void {
-        cy.dataCy(SiteUtils.CHECKBOX_ENABLE_LOCATION_FEATURES).click();
-        cy.dataCy(SiteUtils.INPUT_TILE_SERVER_URL).clear().type(tileServerUrl);
+        cy.dataCy(SiteUtils.CHECKBOX_ENABLE_LOCATION_FEATURES)
+            .children()
+            .click();
+        cy.dataCy(SiteUtils.INPUT_TILE_SERVER_URL, { timeout: 1000 })
+            .clear()
+            .type(tileServerUrl);
         cy.dataCy('sites-location-features-button').click();
     }
 
diff --git a/ui/cypress/support/utils/connect/ConnectUtils.ts b/ui/cypress/support/utils/connect/ConnectUtils.ts
index 190cc77925..aaeccff82c 100644
--- a/ui/cypress/support/utils/connect/ConnectUtils.ts
+++ b/ui/cypress/support/utils/connect/ConnectUtils.ts
@@ -369,6 +369,12 @@ export class ConnectUtils {
             'have.length',
             amountOfProperties,
         );
+
+        cy.wait(1000);
+
+        cy.dataCy('live-preview-table-value')
+            .invoke('text')
+            .then(text => expect(text).not.to.include('no data'));
     }
 
     public static tearDownPreprocessingRuleTest(
diff --git a/ui/cypress/tests/assetManagement/createAsset.spec.ts b/ui/cypress/tests/assetManagement/createAsset.spec.ts
index 7f5171631a..6aa726636d 100644
--- a/ui/cypress/tests/assetManagement/createAsset.spec.ts
+++ b/ui/cypress/tests/assetManagement/createAsset.spec.ts
@@ -40,8 +40,7 @@ describe('Creates a new adapter, add to assets and export assets', () => {
         cy.dataCy('create-new-asset-button').click();
         cy.dataCy('asset-name').clear();
         cy.dataCy('asset-name').type('Test asset');
-        cy.dataCy('save-data-view').click();
-        cy.dataCy('edit-asset-button').click();
+        cy.dataCy('save-asset').click();
         cy.get('.mdc-tab__text-label').contains('Asset Links').parent().click();
         cy.dataCy('assets-manage-links-button', { timeout: 5000 }).should(
             'be.enabled',
@@ -59,63 +58,5 @@ describe('Creates a new adapter, add to assets and export assets', () => {
         DashboardUtils.goToDashboard();
         AssetUtils.goToAssets();
         cy.dataCy('assets-table').should('have.length', 1);
-
-        // Export Asset
-        ConfigurationUtils.goToConfigurationExport();
-        cy.get('[type="checkbox"]').check();
-        cy.dataCy('export-asset-button').click();
-        cy.dataCy('download-export-button').click();
-
-        // Delete Adapter and Asset
-        ConnectUtils.goToConnect();
-        cy.dataCy('delete-adapter').click();
-        cy.dataCy('delete-adapter-confirmation').click();
-
-        AssetUtils.goToAssets();
-        cy.dataCy('delete').click();
-
-        // Import downloaded Asset
-        ConfigurationUtils.goToConfigurationExport();
-        cy.dataCy('import-application-data-button').click();
-        cy.get('input[type="file"]').selectFile(
-            'cypress/downloads/data_export.zip',
-            { force: true },
-        );
-        cy.dataCy('next-import-button').click();
-        cy.dataCy('import-button').click();
-
-        // Check if import was successful
-        ConnectUtils.goToConnect();
-        cy.dataCy('adapters-table').children().should('have.length', 1);
-        AssetUtils.goToAssets();
-        cy.dataCy('assets-table').should('have.length', 1);
-
-        // Export Asset via Assets page
-        cy.dataCy('download').click();
-
-        // Delete Adapter and Asset
-        ConnectUtils.goToConnect();
-        cy.dataCy('delete-adapter').click();
-        cy.dataCy('delete-adapter-confirmation').click();
-
-        AssetUtils.goToAssets();
-        cy.dataCy('delete').click();
-
-        // Import downloaded Asset
-        ConfigurationUtils.goToConfigurationExport();
-        cy.dataCy('import-application-data-button').click();
-        cy.get('input[type="file"]').selectFile(
-            'cypress/downloads/assetExport.zip',
-            { force: true },
-        );
-        cy.dataCy('next-import-button').click();
-        cy.dataCy('import-button').click();
-
-        // Check if import was successful
-        ConnectUtils.goToConnect();
-        cy.dataCy('adapters-table').children().should('have.length', 1);
-
-        AssetUtils.goToAssets();
-        cy.dataCy('assets-table').should('have.length', 1);
     });
 });
diff --git a/ui/cypress/tests/connect/allAdapterActions.smoke.spec.ts b/ui/cypress/tests/connect/allAdapterActions.smoke.spec.ts
index fe91a57070..8b1b2f453c 100644
--- a/ui/cypress/tests/connect/allAdapterActions.smoke.spec.ts
+++ b/ui/cypress/tests/connect/allAdapterActions.smoke.spec.ts
@@ -21,7 +21,7 @@ import { ConnectBtns } from '../../support/utils/connect/ConnectBtns';
 
 describe('Testing Start/Stop All Adapters', () => {
     beforeEach('Setup Test', () => {
-        // To set up test, we are adding 2 stream adapters that can be futher configured
+        // To set up test, we are adding 2 stream adapters that can be further configured
         cy.initStreamPipesTest();
         ConnectUtils.addMachineDataSimulator('simulator-1');
         ConnectUtils.addMachineDataSimulator('simulator-2');
diff --git a/ui/cypress/tests/connect/createAdapterWithoutStarting.spec.ts b/ui/cypress/tests/connect/createAdapterWithoutStarting.spec.ts
index e636098583..3a5fe0b225 100644
--- a/ui/cypress/tests/connect/createAdapterWithoutStarting.spec.ts
+++ b/ui/cypress/tests/connect/createAdapterWithoutStarting.spec.ts
@@ -35,8 +35,6 @@ describe('Creates a new adapter without starting it', () => {
 
         ConnectUtils.startAndValidateAdapter(7);
 
-        ConnectUtils.closeAdapterPreview();
-
-        ConnectUtils.deleteAdapter();
+        //ConnectUtils.deleteAdapter();
     });
 });
diff --git a/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html b/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
index e4acc1423f..71a2830b4c 100644
--- a/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
+++ b/ui/src/app/assets/dialog/create-asset/create-asset-dialog.component.html
@@ -54,7 +54,7 @@
             mat-button
             mat-raised-button
             color="accent"
-            data-cy="save-data-view"
+            data-cy="save-asset"
             (click)="onSave()"
         >
             {{ createMode ? 'Create' : 'Save' }}
diff --git a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html b/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html
index bab6934683..ffaf3bd5b2 100644
--- a/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html
+++ b/ui/src/app/core-ui/pipeline-element-runtime-info/live-preview-table/live-preview-table.component.html
@@ -75,6 +75,7 @@
                     </ng-container>
                     <ng-container *ngIf="element.hasNoDomainProperty">
                         <div
+                            data-cy="live-preview-table-value"
                             class="value"
                             [class.value-changed]="element.valueChanged"
                         >