Skip to content

Commit

Permalink
refactor: Remove wait for 2 seconds in adapter creation (#3162)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthe authored Aug 21, 2024
1 parent 6cce352 commit 6b35759
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
1 change: 0 additions & 1 deletion ui/cypress/support/utils/connect/ConnectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export class ConnectUtils {
}

public static configureAdapter(adapterInput: AdapterInput) {
cy.wait(2000);
StaticPropertyUtils.input(adapterInput.adapterConfiguration);

this.configureFormat(adapterInput);
Expand Down
31 changes: 22 additions & 9 deletions ui/cypress/support/utils/userInput/StaticPropertyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,41 @@ 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)
.click();
} 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,
);
}
});
}
Expand All @@ -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();
});
}
Expand Down

0 comments on commit 6b35759

Please sign in to comment.