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 2022/01/25 11:03:05 UTC
[incubator-streampipes] branch dev updated: [hotfix] Fix failing cypress test
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
The following commit(s) were added to refs/heads/dev by this push:
new 4083f70 [hotfix] Fix failing cypress test
4083f70 is described below
commit 4083f70653e26e4cbef71f54b1844fc548e4e754
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Jan 25 12:02:56 2022 +0100
[hotfix] Fix failing cypress test
---
.../filters-siddhi/count1/expected.csv | 8 ++++----
ui/cypress/support/utils/ConnectEventSchemaUtils.ts | 21 ++++++++++++++-------
ui/cypress/support/utils/DataLakeUtils.ts | 2 +-
.../tests/pipelineElement/SinglePipelineElement.ts | 2 +-
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/count1/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/count1/expected.csv
index 8dba7c6..fbe08b2 100644
--- a/ui/cypress/fixtures/pipelineElement/filters-siddhi/count1/expected.csv
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/count1/expected.csv
@@ -1,4 +1,4 @@
-time;count;value
-1623871499055;1.0;hello
-1623871503078;1.0;world
-1623871503079;2.0;hello
+count;value
+1.0;hello
+1.0;world
+2.0;hello
diff --git a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
index 20e5bdd..c39da21 100644
--- a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
+++ b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
@@ -30,7 +30,8 @@ export class ConnectEventSchemaUtils {
// Mark property as timestamp
this.eventSchemaNextBtnDisabled();
// Edit timestamp
- cy.dataCy('edit-' + propertyName, { timeout: 10000 }).click();
+
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
// Mark as timestamp
cy.dataCy('sp-mark-as-timestamp').children().click();
@@ -48,7 +49,7 @@ export class ConnectEventSchemaUtils {
}
public static editTimestampProperty(propertyName: string, timestampRegex: string) {
- cy.dataCy('edit-' + propertyName.toLowerCase(), { timeout: 10000 }).click();
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
cy.dataCy('sp-mark-as-timestamp').children().click();
cy.dataCy('connect-timestamp-converter').click().get('mat-option').contains('String').click();
cy.dataCy('connect-timestamp-string-regex').type(timestampRegex);
@@ -61,8 +62,8 @@ export class ConnectEventSchemaUtils {
}
public static numberTransformation(propertyName: string, value: string) {
- cy.dataCy('edit-' + propertyName.toLowerCase(), { timeout: 10000 }).click();
- cy.wait(1000);
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
+ // cy.wait(1000);
cy.dataCy('connect-schema-correction-value').type(value);
cy.dataCy('connect-schema-correction-operator').click().get('mat-option').contains('Multiply').click();
@@ -73,7 +74,7 @@ export class ConnectEventSchemaUtils {
}
public static unitTransformation(propertyName: string, fromUnit: string, toUnit: string) {
- cy.dataCy('edit-' + propertyName.toLowerCase(), { timeout: 10000 }).click();
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
cy.dataCy('connect-schema-unit-from-dropdown').type(fromUnit);
cy.dataCy('connect-schema-unit-transform-btn').click();
cy.dataCy('connect-schema-unit-to-dropdown').click().get('mat-option').contains(toUnit).click();
@@ -99,7 +100,8 @@ export class ConnectEventSchemaUtils {
cy.dataCy('sp-save-edit-property').click();
// validate that static value is persisted
- cy.dataCy('edit-' + propertyName.toLowerCase(), { timeout: 10000 }).click();
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
+
cy.dataCy('connect-edit-field-static-value', { timeout: 10000 }).should('have.value', propertyValue);
cy.dataCy('sp-save-edit-property').click();
}
@@ -111,7 +113,7 @@ export class ConnectEventSchemaUtils {
public static changePropertyDataType(propertyName: string, dataType: string) {
- cy.dataCy('edit-' + propertyName, { timeout: 10000 }).click();
+ ConnectEventSchemaUtils.clickEditProperty(propertyName);
cy.dataCy('connect-change-runtime-type').click().get('mat-option').contains(dataType).click();
cy.dataCy('sp-save-edit-property').click();
// validate that static value is persisted
@@ -133,4 +135,9 @@ export class ConnectEventSchemaUtils {
cy.get('#event-schema-next-button').click();
}
+ public static clickEditProperty(propertyName: string) {
+ cy.dataCy('edit-' + propertyName.toLowerCase(), { timeout: 10000 }).click();
+ cy.dataCy('connect-edit-field-runtime-name').should('have.value', propertyName, { timeout: 10000 });
+ }
+
}
diff --git a/ui/cypress/support/utils/DataLakeUtils.ts b/ui/cypress/support/utils/DataLakeUtils.ts
index 9b31a78..7150002 100644
--- a/ui/cypress/support/utils/DataLakeUtils.ts
+++ b/ui/cypress/support/utils/DataLakeUtils.ts
@@ -252,7 +252,7 @@ export class DataLakeUtils {
} else {
actualResult = DataLakeUtils.parseCsv(actual);
}
- const expectedResult = ignoreTime ? DataLakeUtils.parseCsv(expected).map(row => row.splice(1)) : DataLakeUtils.parseCsv(expected);
+ const expectedResult = DataLakeUtils.parseCsv(expected);
expect(actualResult).to.deep.equal(expectedResult);
}
diff --git a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
index f7cd0ec..c223236 100644
--- a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
+++ b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
@@ -22,7 +22,7 @@ import { ProcessorTest } from '../../support/model/ProcessorTest';
const allTests = Cypress.env('processingElements');
allTests.forEach(test => {
- const testNames = ['increase1'];
+ const testNames = ['count1'];
const processorTest = test as ProcessorTest;