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 2023/04/05 06:29:05 UTC

[streampipes] branch dev updated: [#1289] Fix cypress test for data lake configuration (#1480)

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

riemer 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 cdcd83ea2 [#1289] Fix cypress test for data lake configuration (#1480)
cdcd83ea2 is described below

commit cdcd83ea21736ae8fafe9772d15cad45027500ff
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Wed Apr 5 08:28:59 2023 +0200

    [#1289] Fix cypress test for data lake configuration (#1480)
    
    * [#1289] Fix cypress test for data lake configuration
    
    * [#1289] Fix delete data in datalake test
---
 ui/cypress/support/utils/PrepareTestDataUtils.ts      | 8 +++++---
 ui/cypress/tests/datalake/configuration.smoke.spec.ts | 7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ui/cypress/support/utils/PrepareTestDataUtils.ts b/ui/cypress/support/utils/PrepareTestDataUtils.ts
index 6ff139280..c90726f26 100644
--- a/ui/cypress/support/utils/PrepareTestDataUtils.ts
+++ b/ui/cypress/support/utils/PrepareTestDataUtils.ts
@@ -19,7 +19,6 @@
 import { FileManagementUtils } from './FileManagementUtils';
 import { ConnectUtils } from './connect/ConnectUtils';
 import { GenericAdapterBuilder } from '../builder/GenericAdapterBuilder';
-import { UserInputBuilder } from '../builder/UserInputBuilder';
 
 export class PrepareTestDataUtils {
     public static dataName = 'prepared_data';
@@ -38,7 +37,9 @@ export class PrepareTestDataUtils {
             storeInDataLake,
         );
 
-        ConnectUtils.addGenericStreamAdapter(adapter);
+        ConnectUtils.addGenericAdapter(adapter);
+
+        ConnectUtils.startAdapter(adapter, true);
     }
 
     private static getDataLakeTestAdapter(
@@ -53,7 +54,8 @@ export class PrepareTestDataUtils {
                 'radio',
                 'speed',
                 'fastest_\\(ignore_original_time\\)',
-            );
+            )
+            .addProtocolInput('radio', 'replayonce', 'yes');
 
         if (format === 'csv') {
             adapterBuilder
diff --git a/ui/cypress/tests/datalake/configuration.smoke.spec.ts b/ui/cypress/tests/datalake/configuration.smoke.spec.ts
index 6fe4ce897..3b5532e15 100644
--- a/ui/cypress/tests/datalake/configuration.smoke.spec.ts
+++ b/ui/cypress/tests/datalake/configuration.smoke.spec.ts
@@ -39,10 +39,13 @@ describe('Test Truncate data in datalake', () => {
             .should('be.visible')
             .click();
 
-        // Check if amount of events is zero
+        // Check if amount of events is zero. The should('have.text, '0') is required to check for text equality
         cy.dataCy('datalake-number-of-events', { timeout: 10000 })
             .should('be.visible')
-            .contains('0');
+            .should($element => {
+                const text = $element.text().trim();
+                expect(text).to.equal('0');
+            });
     });
 });