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/10/07 08:20:03 UTC
[incubator-streampipes] 02/02: [STREAMPIPES-583] Add cypress tests to download csv and json files
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch STREAMPIPES-583
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 1acf16d826ae31de657ed10348611f43c21ee928
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Fri Oct 7 10:19:50 2022 +0200
[STREAMPIPES-583] Add cypress tests to download csv and json files
---
ui/cypress/fixtures/dataDownloadDialog/input.json | 5 +
ui/cypress/fixtures/dataDownloadDialog/test1.csv | 11 --
ui/cypress/fixtures/dataDownloadDialog/test2.csv | 11 --
.../fixtures/dataDownloadDialog/testCsvComma.csv | 5 +
.../dataDownloadDialog/testCsvSemicolon.csv | 5 +
.../fixtures/dataDownloadDialog/testJson.json | 1 +
.../support/builder/GenericAdapterBuilder.ts | 2 +-
ui/cypress/support/general/dataCy.ts | 7 +-
ui/cypress/support/utils/ConnectUtils.ts | 1 -
.../support/utils/DataDownloadDialogUtils.ts | 19 +++-
ui/cypress/support/utils/DataLakeUtils.ts | 119 ++++++++++-----------
ui/cypress/support/utils/PrepareTestDataUtils.ts | 67 ++++++++++++
.../dataDownloadDialogTest.smoke.spec.ts | 48 ++++++---
.../tests/datalake/testSpecialCharactersInName.ts | 85 ---------------
14 files changed, 193 insertions(+), 193 deletions(-)
diff --git a/ui/cypress/fixtures/dataDownloadDialog/input.json b/ui/cypress/fixtures/dataDownloadDialog/input.json
new file mode 100644
index 000000000..59705f7af
--- /dev/null
+++ b/ui/cypress/fixtures/dataDownloadDialog/input.json
@@ -0,0 +1,5 @@
+[{"timestamp": 1623871499055, "v1": 4.1, "v2": "abc", "v3": true, "v4": 1},
+{"timestamp": 1623871500059, "v1": 4.2, "v2": "abc", "v3": false, "v4": 2},
+{"timestamp": 1623871507091, "v1": 4.3, "v4": 3},
+{"timestamp": 1623871508093, "v1": 4.4, "v2": "abc", "v3": true, "v4": 4},
+{"timestamp": 1623871508093, "v1": 4.5, "v4": 5}]
diff --git a/ui/cypress/fixtures/dataDownloadDialog/test1.csv b/ui/cypress/fixtures/dataDownloadDialog/test1.csv
deleted file mode 100644
index 76f73b9ec..000000000
--- a/ui/cypress/fixtures/dataDownloadDialog/test1.csv
+++ /dev/null
@@ -1,11 +0,0 @@
-time;randombool;randomnumber;randomtext
-1653871499055;true;62.0;c
-1653871500059;false;46.0;a
-1653871501064;true;41.0;b
-1653871502070;true;41.0;b
-1653871503078;false;22.0;b
-1653871504082;true;56.0;a
-1653871505084;false;77.0;b
-1653871506086;true;77.0;a
-1653871507091;true;85.0;b
-1653871508093;false;22.0;a
diff --git a/ui/cypress/fixtures/dataDownloadDialog/test2.csv b/ui/cypress/fixtures/dataDownloadDialog/test2.csv
deleted file mode 100644
index b37d591b3..000000000
--- a/ui/cypress/fixtures/dataDownloadDialog/test2.csv
+++ /dev/null
@@ -1,11 +0,0 @@
-time,randombool,randomnumber,randomtext
-1653871499055,true,62.0,c
-1653871500059,false,46.0,a
-1653871501064,true,41.0,b
-1653871502070,true,41.0,b
-1653871503078,false,22.0,b
-1653871504082,true,56.0,a
-1653871505084,false,77.0,b
-1653871506086,true,77.0,a
-1653871507091,true,85.0,b
-1653871508093,false,22.0,a
diff --git a/ui/cypress/fixtures/dataDownloadDialog/testCsvComma.csv b/ui/cypress/fixtures/dataDownloadDialog/testCsvComma.csv
new file mode 100644
index 000000000..b73f15230
--- /dev/null
+++ b/ui/cypress/fixtures/dataDownloadDialog/testCsvComma.csv
@@ -0,0 +1,5 @@
+time,v1,v2,v3,v4
+1623871499055,4.099999904632568,abc,true,1.0
+1623871500059,4.199999809265137,abc,false,2.0
+1623871507091,4.300000190734863,,,3.0
+1623871508093,4.5,abc,true,5.0
diff --git a/ui/cypress/fixtures/dataDownloadDialog/testCsvSemicolon.csv b/ui/cypress/fixtures/dataDownloadDialog/testCsvSemicolon.csv
new file mode 100644
index 000000000..402dabcac
--- /dev/null
+++ b/ui/cypress/fixtures/dataDownloadDialog/testCsvSemicolon.csv
@@ -0,0 +1,5 @@
+time;v1;v2;v3;v4
+1623871499055;4.099999904632568;abc;true;1.0
+1623871500059;4.199999809265137;abc;false;2.0
+1623871507091;4.300000190734863;;;3.0
+1623871508093;4.5;abc;true;5.0
diff --git a/ui/cypress/fixtures/dataDownloadDialog/testJson.json b/ui/cypress/fixtures/dataDownloadDialog/testJson.json
new file mode 100644
index 000000000..31f352cf4
--- /dev/null
+++ b/ui/cypress/fixtures/dataDownloadDialog/testJson.json
@@ -0,0 +1 @@
+[{"time": 1623871499055,"v1": 4.099999904632568,"v2": "abc","v3": true,"v4": 1.0},{"time": 1623871500059,"v1": 4.199999809265137,"v2": "abc","v3": false,"v4": 2.0},{"time": 1623871507091,"v1": 4.300000190734863,"v2": null,"v3": null,"v4": 3.0},{"time": 1623871508093,"v1": 4.5,"v2": "abc","v3": true,"v4": 5.0}]
diff --git a/ui/cypress/support/builder/GenericAdapterBuilder.ts b/ui/cypress/support/builder/GenericAdapterBuilder.ts
index f06962ab2..f9c0e24ae 100644
--- a/ui/cypress/support/builder/GenericAdapterBuilder.ts
+++ b/ui/cypress/support/builder/GenericAdapterBuilder.ts
@@ -65,7 +65,7 @@ export class GenericAdapterBuilder {
return this;
}
- public setFormat(format: string) {
+ public setFormat(format: 'csv'| 'json_array') {
this.genericAdapterInput.format = format;
return this;
}
diff --git a/ui/cypress/support/general/dataCy.ts b/ui/cypress/support/general/dataCy.ts
index 7a2e98ad7..ff1d54bea 100644
--- a/ui/cypress/support/general/dataCy.ts
+++ b/ui/cypress/support/general/dataCy.ts
@@ -19,15 +19,12 @@
declare global {
namespace Cypress {
interface Chainable {
- /**
- * Select cypress id's ([data-cy=...])
- */
- dataCy(value: string, config?: any): Chainable<Element>;
+ dataCy: typeof dataCy;
}
}
}
-export const dataCy = (value, config?) => {
+export const dataCy = (value: string, config?: any) => {
if (config) {
return cy.get(`[data-cy=${value}]`, config);
} else {
diff --git a/ui/cypress/support/utils/ConnectUtils.ts b/ui/cypress/support/utils/ConnectUtils.ts
index dc8c39040..bc35ac044 100644
--- a/ui/cypress/support/utils/ConnectUtils.ts
+++ b/ui/cypress/support/utils/ConnectUtils.ts
@@ -58,7 +58,6 @@ export class ConnectUtils {
}
-
public static addGenericStreamAdapter(adapterConfiguration: GenericAdapterInput) {
ConnectUtils.addGenericAdapter(adapterConfiguration);
diff --git a/ui/cypress/support/utils/DataDownloadDialogUtils.ts b/ui/cypress/support/utils/DataDownloadDialogUtils.ts
index e171121ae..177ad3dea 100644
--- a/ui/cypress/support/utils/DataDownloadDialogUtils.ts
+++ b/ui/cypress/support/utils/DataDownloadDialogUtils.ts
@@ -22,6 +22,18 @@ import { FileNameService } from '../../../src/app/core-ui/data-download-dialog/s
import { CsvFormatExportConfig } from '../../../src/app/core-ui/data-download-dialog/model/format-export-config.model';
export class DataDownloadDialogUtils {
+
+ // public static getDataDownloadTestAdapter() {
+ // return GenericAdapterBuilder
+ // .create('File_Set')
+ // .setName('dataDownloadDialogTest/input.json')
+ // .setTimestampProperty('timestamp')
+ // .setFormat('json_array')
+ // .setStoreInDataLake()
+ // .build();
+ //
+ // }
+
public static testDownload(exportConfig: ExportConfig,
resultFileLocation: string,
dataViewName: string) {
@@ -32,8 +44,7 @@ export class DataDownloadDialogUtils {
DataLakeUtils.editDataView(dataViewName);
// select download button
- const widgetName = 'download-datalake_configuration-table';
- cy.dataCy(widgetName)
+ cy.dataCy('download-prepared_data-table')
.click();
// download-customInterval, download-all, download-visible
@@ -61,9 +72,9 @@ export class DataDownloadDialogUtils {
const fileNameService: FileNameService = new FileNameService();
const fileName = fileNameService.generateName(exportConfig, new Date());
const downloadsFolder = Cypress.config('downloadsFolder');
- cy.readFile(downloadsFolder + '/' + fileName).then((downloadFileString) => {
+ cy.readFile(downloadsFolder + '/' + fileName).then((downloadFileString: string) => {
cy.readFile(`cypress/fixtures/dataDownloadDialog/${resultFileLocation}`).then((expectedResultString) => {
- expect(downloadFileString === expectedResultString);
+ expect(expectedResultString).to.deep.equal(downloadFileString);
});
});
}
diff --git a/ui/cypress/support/utils/DataLakeUtils.ts b/ui/cypress/support/utils/DataLakeUtils.ts
index b976c81ce..acacdea6f 100644
--- a/ui/cypress/support/utils/DataLakeUtils.ts
+++ b/ui/cypress/support/utils/DataLakeUtils.ts
@@ -16,12 +16,11 @@
*
*/
-import { FileManagementUtils } from './FileManagementUtils';
import { GenericAdapterBuilder } from '../builder/GenericAdapterBuilder';
-import { ConnectUtils } from './ConnectUtils';
import { DataLakeFilterConfig } from '../model/DataLakeFilterConfig';
import { DataExplorerWidget } from '../model/DataExplorerWidget';
import { DataSetUtils } from './DataSetUtils';
+import { PrepareTestDataUtils } from './PrepareTestDataUtils';
export class DataLakeUtils {
@@ -29,15 +28,24 @@ export class DataLakeUtils {
cy.visit('#/dataexplorer');
}
- public static getDataLakeTestSetAdapter(name: string, storeInDataLake: boolean = true) {
+ public static getDataLakeTestSetAdapter(name: string,
+ storeInDataLake: boolean = true,
+ format: 'csv' | 'json_array') {
const adapterBuilder = GenericAdapterBuilder
- .create('File_Set')
- .setName(name)
- .setTimestampProperty('timestamp')
- .addDimensionProperty('randomtext')
+ .create('File_Set')
+ .setName(name)
+ .setTimestampProperty('timestamp')
+ .addDimensionProperty('randomtext');
+
+ if (format === 'csv') {
+ adapterBuilder
.setFormat('csv')
.addFormatInput('input', 'delimiter', ';')
.addFormatInput('checkbox', 'header', 'check');
+ } else {
+ adapterBuilder
+ .setFormat('json_array');
+ }
if (storeInDataLake) {
adapterBuilder.setStoreInDataLake();
@@ -45,25 +53,26 @@ export class DataLakeUtils {
return adapterBuilder.build();
}
- public static loadDataIntoDataLake(dataSet: string, wait = true) {
- // Create adapter with dataset
- FileManagementUtils.addFile(dataSet);
-
- const adapter = this.getDataLakeTestSetAdapter('datalake_configuration');
- ConnectUtils.addGenericSetAdapter(adapter);
-
- // Wait till data is stored
- if (wait) {
- cy.wait(10000);
- }
- }
+ //
+ // public static loadDataIntoDataLake(dataSet: string, wait = true, format: 'csv' | 'json_array' = 'csv') {
+ // // Create adapter with dataset
+ // FileManagementUtils.addFile(dataSet);
+ //
+ // const adapter = this.getDataLakeTestSetAdapter('datalake_configuration', true, format);
+ // ConnectUtils.addGenericSetAdapter(adapter);
+ //
+ // // Wait till data is stored
+ // if (wait) {
+ // cy.wait(10000);
+ // }
+ // }
public static addDataViewAndWidget(dataViewName: string, dataSet: string, widgetType: string) {
DataLakeUtils.goToDatalake();
DataLakeUtils.createAndEditDataView(dataViewName);
DataLakeUtils.selectTimeRange(
- new Date(2020, 10, 20, 22, 44),
- new Date(2021, 10, 20, 22, 44));
+ new Date(2020, 10, 20, 22, 44),
+ new Date(2021, 10, 20, 22, 44));
// DataLakeUtils.addNewWidget();
DataLakeUtils.selectDataSet(dataSet);
DataLakeUtils.dataConfigSelectAllFields();
@@ -83,7 +92,7 @@ export class DataLakeUtils {
}
public static loadRandomDataSetIntoDataLake() {
- this.loadDataIntoDataLake('fileTest/random.csv');
+ PrepareTestDataUtils.loadDataIntoDataLake('fileTest/random.csv');
}
@@ -91,12 +100,12 @@ export class DataLakeUtils {
// Create new data view
cy.dataCy('open-new-data-view-dialog')
- .click();
+ .click();
// Configure data view
cy.dataCy('data-view-name').type(name);
cy.dataCy('save-data-view')
- .click();
+ .click();
this.editDataView(name);
@@ -110,11 +119,11 @@ export class DataLakeUtils {
// Click edit button
// following only works if single view is available
cy.dataCy('edit-dashboard-' + dataViewName)
- .click();
+ .click();
}
public static saveDataExplorerWidgetConfiguration() {
- cy.dataCy('save-data-explorer-widget-btn', { timeout: 10000 }).click();
+ cy.dataCy('save-data-explorer-widget-btn', {timeout: 10000}).click();
}
public static editWidget(widgetName: string) {
@@ -141,21 +150,21 @@ export class DataLakeUtils {
public static goBackToOverview() {
cy.dataCy('save-data-explorer-go-back-to-overview')
- .click();
+ .click();
}
public static addNewWidget() {
cy.dataCy('add-new-widget')
- .click();
+ .click();
}
public static selectDataSet(dataSet: string) {
cy.dataCy('data-explorer-select-data-set')
- .click()
- .get('mat-option')
- .contains(dataSet)
- .click();
+ .click()
+ .get('mat-option')
+ .contains(dataSet)
+ .click();
}
@@ -167,7 +176,7 @@ export class DataLakeUtils {
if (amountOfFilter === 0) {
cy.dataCy('design-panel-data-settings-filter-field').should('not.exist');
} else {
- cy.dataCy('design-panel-data-settings-filter-field', { timeout: 20000 }).should('be.visible');
+ cy.dataCy('design-panel-data-settings-filter-field', {timeout: 20000}).should('be.visible');
}
}
@@ -176,36 +185,36 @@ export class DataLakeUtils {
*/
public static dataConfigSelectAllFields() {
cy.dataCy('data-explorer-data-set-field-select-all')
- .click();
+ .click();
}
public static dataConfigAddFilter(filterConfig: DataLakeFilterConfig) {
cy.dataCy('design-panel-data-settings-add-filter')
- .click();
+ .click();
// Select field
cy.dataCy('design-panel-data-settings-filter-field')
- .click()
- .get('mat-option')
- .contains(filterConfig.field)
- .click();
+ .click()
+ .get('mat-option')
+ .contains(filterConfig.field)
+ .click();
// Select value
cy.dataCy('design-panel-data-settings-filter-value').type(filterConfig.value);
// Select operator
cy.dataCy('design-panel-data-settings-filter-operator')
- .click()
- .get('mat-option')
- .contains(filterConfig.operator)
- .click();
+ .click()
+ .get('mat-option')
+ .contains(filterConfig.operator)
+ .click();
}
public static dataConfigRemoveFilter() {
cy.dataCy('design-panel-data-settings-remove-filter')
- .first()
- .click();
+ .first()
+ .click();
}
public static clickGroupBy(propertyName: string) {
@@ -218,10 +227,10 @@ export class DataLakeUtils {
public static selectVisualizationType(type: string | 'Table') {
// Select visualization type
cy.dataCy('data-explorer-select-visualization-type')
- .click()
- .get('mat-option')
- .contains(type)
- .click();
+ .click()
+ .get('mat-option')
+ .contains(type)
+ .click();
}
public static selectDataConfig() {
@@ -240,7 +249,7 @@ export class DataLakeUtils {
public static clickCreateButton() {
// Create widget
cy.dataCy('data-explorer-select-data-set-create-btn')
- .click();
+ .click();
}
public static goToDatalakeConfiguration() {
@@ -274,14 +283,4 @@ export class DataLakeUtils {
// DataLakeUtils.setTimeInput('time-range-to', to);
}
- private static setTimeInput(selector: string, value: Date) {
- cy.dataCy(selector)
- .click();
- cy.wait(500);
- cy.get('.owl-dt-control-button-content').contains('Set').click({ 'force': true });
- cy.dataCy(selector)
- .clear()
- .type(`${value.toLocaleString()}{enter}`);
- }
-
}
diff --git a/ui/cypress/support/utils/PrepareTestDataUtils.ts b/ui/cypress/support/utils/PrepareTestDataUtils.ts
new file mode 100644
index 000000000..eeae95398
--- /dev/null
+++ b/ui/cypress/support/utils/PrepareTestDataUtils.ts
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { FileManagementUtils } from './FileManagementUtils';
+import { ConnectUtils } from './ConnectUtils';
+import { GenericAdapterBuilder } from '../builder/GenericAdapterBuilder';
+
+export class PrepareTestDataUtils {
+
+ public static dataName = 'prepared_data';
+
+ public static loadDataIntoDataLake(dataSet: string,
+ format: 'csv' | 'json_array' = 'csv',
+ storeInDataLake: boolean = true) {
+ // Create adapter with dataset
+ FileManagementUtils.addFile(dataSet);
+
+ const adapter = this.getDataLakeTestSetAdapter(PrepareTestDataUtils.dataName, format, storeInDataLake);
+ ConnectUtils.addGenericSetAdapter(adapter);
+
+ // Wait till data is stored
+ if (storeInDataLake) {
+ cy.wait(10000);
+ }
+ }
+
+ private static getDataLakeTestSetAdapter(name: string,
+ format: 'csv' | 'json_array',
+ storeInDataLake: boolean = true) {
+ const adapterBuilder = GenericAdapterBuilder
+ .create('File_Set')
+ .setName(name)
+ .setTimestampProperty('timestamp');
+
+ if (format === 'csv') {
+ adapterBuilder
+ .setFormat('csv')
+ .addFormatInput('input', 'delimiter', ';')
+ .addFormatInput('checkbox', 'header', 'check');
+ } else {
+ adapterBuilder
+ .setFormat('json_array');
+ }
+
+ if (storeInDataLake) {
+ adapterBuilder.setStoreInDataLake();
+ }
+ return adapterBuilder.build();
+ }
+
+
+}
diff --git a/ui/cypress/tests/dataDownloadDialog/dataDownloadDialogTest.smoke.spec.ts b/ui/cypress/tests/dataDownloadDialog/dataDownloadDialogTest.smoke.spec.ts
index 4e94c3fd4..0fbc3c0c1 100644
--- a/ui/cypress/tests/dataDownloadDialog/dataDownloadDialogTest.smoke.spec.ts
+++ b/ui/cypress/tests/dataDownloadDialog/dataDownloadDialogTest.smoke.spec.ts
@@ -18,44 +18,62 @@
import { ExportConfig } from '../../../src/app/core-ui/data-download-dialog/model/export-config.model';
import { DataDownloadDialogUtils } from '../../support/utils/DataDownloadDialogUtils';
-import { CsvFormatExportConfig } from '../../../src/app/core-ui/data-download-dialog/model/format-export-config.model';
import { DataLakeUtils } from '../../support/utils/DataLakeUtils';
+import { PrepareTestDataUtils } from '../../support/utils/PrepareTestDataUtils';
describe('Test live data download dialog', () => {
before('Setup Test', () => {
cy.initStreamPipesTest();
- DataLakeUtils.loadDataIntoDataLake('datalake/sample.csv');
+ PrepareTestDataUtils.loadDataIntoDataLake('dataDownloadDialog/input.json', 'json_array');
DataLakeUtils.addDataViewAndTableWidget(dataViewName, 'Persist');
DataLakeUtils.saveDataExplorerWidgetConfiguration();
});
beforeEach('Setup Test', () => {
cy.login();
+ cy.removeDownloadDirectory();
});
const dataViewName = 'TestView';
- const exportConfig: ExportConfig = {
+ const formatTestsExportConfig: ExportConfig = {
+ formatExportConfig: undefined,
dataExportConfig: {
dataRangeConfiguration: 'all',
missingValueBehaviour: 'ignore',
- measurement: 'datalake_configuration'
- },
- formatExportConfig: {
- exportFormat: 'csv',
- delimiter: 'semicolon'
+ measurement: 'prepared_data'
}
};
- it('Data Explorer CSV with Semicolon', () => {
- const resultFile = 'test1.csv';
- DataDownloadDialogUtils.testDownload(exportConfig, resultFile, dataViewName);
+ it('Test csv export with semicolon', () => {
+ formatTestsExportConfig.formatExportConfig = {
+ exportFormat: 'csv',
+ delimiter: 'semicolon'
+ };
+ const resultFile = 'testCsvSemicolon.csv';
+
+ DataDownloadDialogUtils.testDownload(formatTestsExportConfig, resultFile, dataViewName);
});
- it('Data Explorer CSV with Semicolon', () => {
- (exportConfig.formatExportConfig as CsvFormatExportConfig).delimiter = 'comma';
- const resultFile = 'test2.csv';
- DataDownloadDialogUtils.testDownload(exportConfig, resultFile, dataViewName);
+ it('Test csv export with comma', () => {
+ formatTestsExportConfig.formatExportConfig = {
+ exportFormat: 'csv',
+ delimiter: 'comma'
+ };
+ const resultFile = 'testCsvComma.csv';
+
+ DataDownloadDialogUtils.testDownload(formatTestsExportConfig, resultFile, dataViewName);
});
+
+ it('Test json export', () => {
+ formatTestsExportConfig.formatExportConfig = {
+ exportFormat: 'json'
+ };
+
+ const resultFile = 'testJson.json';
+ DataDownloadDialogUtils.testDownload(formatTestsExportConfig, resultFile, dataViewName);
+ });
+
+ // TODO make a list of all configurations
});
diff --git a/ui/cypress/tests/datalake/testSpecialCharactersInName.ts b/ui/cypress/tests/datalake/testSpecialCharactersInName.ts
deleted file mode 100644
index a0bf4afe1..000000000
--- a/ui/cypress/tests/datalake/testSpecialCharactersInName.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import { DataLakeUtils } from '../../support/utils/DataLakeUtils';
-import { ConnectUtils } from '../../support/utils/ConnectUtils';
-import { PipelineBuilder } from '../../support/builder/PipelineBuilder';
-import { PipelineElementBuilder } from '../../support/builder/PipelineElementBuilder';
-import { PipelineUtils } from '../../support/utils/PipelineUtils';
-import { FileManagementUtils } from '../../support/utils/FileManagementUtils';
-
-
-describe('Test Table View in Data Explorer', () => {
-
- beforeEach('Setup Test', () => {
- cy.initStreamPipesTest();
- });
-
- it('Perform Test', () => {
-
- FileManagementUtils.addFile('fileTest/random.csv');
-
- // TODO this test must be fixed and extended with more special characters
- const dataLakeName = 'specialCharacters';
- const adapterName = 'adaptername';
- // Add Adpater
-
- const adapter = DataLakeUtils.getDataLakeTestSetAdapter(adapterName, false);
- ConnectUtils.addGenericSetAdapter(adapter);
-
- const pipelineInput = PipelineBuilder.create(dataLakeName)
- .addSource(adapterName)
- .addSourceType('set')
- .addSink(
- PipelineElementBuilder.create('data_lake')
- .addInput('input', 'db_measurement', dataLakeName)
- .build())
- .build();
-
- PipelineUtils.testPipeline(pipelineInput);
-
- // Wait till data is stored
- cy.wait(10000);
-
- // Build Pipeline
-
- DataLakeUtils.goToDatalake();
-
- DataLakeUtils.createAndEditDataView('widgetName');
-
- DataLakeUtils.addNewWidget();
-
- DataLakeUtils.selectDataSet(dataLakeName);
-
- DataLakeUtils.dataConfigSelectAllFields();
-
- DataLakeUtils.selectVisualizationConfig();
-
- DataLakeUtils.selectVisualizationType('Table');
-
- DataLakeUtils.clickCreateButton();
-
- DataLakeUtils.selectTimeRange(
- new Date(2020, 10, 20, 22, 44),
- new Date(2021, 10, 20, 22, 44));
-
- cy.dataCy('data-explorer-table-row', {timeout: 10000}).should('have.length', 10);
-
- });
-
-});