From ada9657e8064caac20abf1924a13886da48ee66d Mon Sep 17 00:00:00 2001 From: Philipp Zehnder Date: Wed, 21 Aug 2024 08:13:38 +0200 Subject: [PATCH] fix(#3163): Nodes are only reloaded with a full configuration (#3164) --- ui/cypress/support/utils/ErrorMessageUtils.ts | 4 ++++ .../connect/opcua/opcAdapterConfiguration.spec.ts | 14 ++++++++++---- .../sp-exception-message.component.html | 7 ++++++- ...atic-runtime-resolvable-tree-input.component.ts | 9 +++++++-- .../static-tree-input-button-menu.component.html | 1 + 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ui/cypress/support/utils/ErrorMessageUtils.ts b/ui/cypress/support/utils/ErrorMessageUtils.ts index 31aa9baa3a..f1e5db2cd1 100644 --- a/ui/cypress/support/utils/ErrorMessageUtils.ts +++ b/ui/cypress/support/utils/ErrorMessageUtils.ts @@ -17,6 +17,10 @@ */ export class ErrorMessageUtils { + public static getExceptionComponent() { + return cy.dataCy('display-exception'); + } + /** * Validates that an error message is displayed and that this message contains the @param message */ diff --git a/ui/cypress/tests/connect/opcua/opcAdapterConfiguration.spec.ts b/ui/cypress/tests/connect/opcua/opcAdapterConfiguration.spec.ts index 6dc6624e33..8889c18542 100644 --- a/ui/cypress/tests/connect/opcua/opcAdapterConfiguration.spec.ts +++ b/ui/cypress/tests/connect/opcua/opcAdapterConfiguration.spec.ts @@ -153,7 +153,7 @@ describe('Test OPC-UA Adapter Configuration', () => { const getAdapterBuilder = () => { const host: string = ParameterUtils.get('localhost', 'opcua'); - const builder = AdapterBuilder.create('OPC_UA') + return AdapterBuilder.create('OPC_UA') .setName('OPC UA Configuration Test') .addInput('radio', 'adapter_type-pull_mode', '') .addInput('input', 'undefined-PULLING_INTERVAL-0', '1000') @@ -164,15 +164,21 @@ const getAdapterBuilder = () => { 'undefined-OPC_SERVER_URL-0', 'opc.tcp://' + host + ':50000', ) - .setAutoAddTimestampPropery(); - - return builder; }; const setUpInitialConfiguration = (adapterInput: AdapterInput) => { ConnectUtils.goToConnect(); ConnectUtils.goToNewAdapterPage(); ConnectUtils.selectAdapter(adapterInput.adapterType); + + // Wait for the first static property to be rendered + cy.dataCy(adapterInput.adapterConfiguration[0].selector).should( + 'be.visible', + ); + // Validate that no error is not shown when nothing is configured + cy.dataCy('reloading-nodes', { timeout: 3000 }).should('not.exist'); + ErrorMessageUtils.getExceptionComponent().should('not.exist'); + StaticPropertyUtils.input(adapterInput.adapterConfiguration); }; diff --git a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html index 741bc96a9f..2efd80acc1 100644 --- a/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html +++ b/ui/projects/streampipes/shared-ui/src/lib/components/sp-exception-message/sp-exception-message.component.html @@ -16,7 +16,12 @@ ~ --> -
+