Skip to content

Commit

Permalink
improve tree-select driver to allow selecting values across multiple …
Browse files Browse the repository at this point in the history
…levels
  • Loading branch information
tomaskikutis committed Sep 19, 2023
1 parent 3281f89 commit 2038dec
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions e2e/client/specs/helpers/tree-select-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ export class TreeSelectDriver {
});
}

addValue(value: string): void {
addValue(value: string | Array<string>): void {
el(['open-popover'], null, this._element).click();

element(by.cssContainingText('[data-test-id="tree-select-popover"] [data-test-id="option"]', value)).click();
const values = typeof value === 'string' ? [value] : value;

for (let i = 0; i < values.length; i++) {
element(
by.cssContainingText(
'[data-test-id="tree-select-popover"] [data-test-id="option"]',
values[i],
),
).click();
}
}

setValue(value: string) {
setValue(value: string | Array<string>) {
const maybeClearButton = this._element.element(s(['clear-value']));

maybeClearButton.isPresent().then((present) => {
Expand Down

0 comments on commit 2038dec

Please sign in to comment.