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 2024/08/20 13:45:30 UTC
(streampipes) 01/01: refactor: Remove wait for 2 seconds in adapter creation
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch hotfix-remove-wait-for-adapters-in-cypress-tests
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 41f9e74ece38fc294328346569ea9946b4e03ddb
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Tue Aug 20 15:45:17 2024 +0200
refactor: Remove wait for 2 seconds in adapter creation
---
ui/cypress/support/utils/connect/ConnectUtils.ts | 1 -
.../support/utils/userInput/StaticPropertyUtils.ts | 31 +++++++++++++++-------
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/ui/cypress/support/utils/connect/ConnectUtils.ts b/ui/cypress/support/utils/connect/ConnectUtils.ts
index da59e92d98..6bd10f86d8 100644
--- a/ui/cypress/support/utils/connect/ConnectUtils.ts
+++ b/ui/cypress/support/utils/connect/ConnectUtils.ts
@@ -124,7 +124,6 @@ export class ConnectUtils {
}
public static configureAdapter(adapterInput: AdapterInput) {
- cy.wait(2000);
StaticPropertyUtils.input(adapterInput.adapterConfiguration);
this.configureFormat(adapterInput);
diff --git a/ui/cypress/support/utils/userInput/StaticPropertyUtils.ts b/ui/cypress/support/utils/userInput/StaticPropertyUtils.ts
index f588f5db49..34b84673f3 100644
--- a/ui/cypress/support/utils/userInput/StaticPropertyUtils.ts
+++ b/ui/cypress/support/utils/userInput/StaticPropertyUtils.ts
@@ -26,9 +26,9 @@ export class StaticPropertyUtils {
if (config.type === 'checkbox') {
this.clickCheckbox(config);
} else if (config.type === 'button') {
- cy.dataCy(config.selector).click();
+ cy.dataCy(config.selector, { timeout: 2000 }).click();
} else if (config.type === 'drop-down') {
- cy.dataCy(config.selector)
+ cy.dataCy(config.selector, { timeout: 2000 })
.click()
.get('mat-option')
.contains(config.value)
@@ -36,18 +36,31 @@ export class StaticPropertyUtils {
} else if (config.type === 'radio') {
this.clickRadio(config);
} else if (config.type === 'click') {
- cy.dataCy(config.selector).click({ force: true });
+ cy.dataCy(config.selector, { timeout: 2000 }).click({
+ force: true,
+ });
} else if (config.type === 'code-input') {
- cy.dataCy('reset-code-' + config.selector).click();
- cy.dataCy('code-editor-' + config.selector).type(config.value);
+ cy.dataCy('reset-code-' + config.selector, {
+ timeout: 2000,
+ }).click();
+ cy.dataCy('code-editor-' + config.selector, {
+ timeout: 2000,
+ }).type(config.value);
} else if (config.type === 'input') {
- cy.dataCy(config.selector).clear().type(config.value).blur();
+ cy.dataCy(config.selector, { timeout: 2000 })
+ .clear()
+ .type(config.value)
+ .blur();
} else if (config.type === 'slider') {
- cy.dataCy(config.selector).type(config.value);
+ cy.dataCy(config.selector, { timeout: 2000 }).type(
+ config.value,
+ );
} else if (config.type === 'tree') {
TreeStaticPropertyUtils.selectTreeNode(config.treeNode);
} else {
- cy.dataCy(config.selector).type(config.value);
+ cy.dataCy(config.selector, { timeout: 2000 }).type(
+ config.value,
+ );
}
});
}
@@ -66,7 +79,7 @@ export class StaticPropertyUtils {
}
private static clickSelectionInput(selector: string, cssClassName: string) {
- cy.dataCy(selector).within(() => {
+ cy.dataCy(selector, { timeout: 2000 }).within(() => {
cy.get(cssClassName).click();
});
}