Skip to content

Commit ecfe780

Browse files
committed
fix for logical db
1 parent 25f718e commit ecfe780

File tree

1 file changed

+16
-4
lines changed
  • tests/e2e/src/page-objects/components/tree-view

1 file changed

+16
-4
lines changed

tests/e2e/src/page-objects/components/tree-view/TreeView.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export class TreeView extends WebView {
2323
sortKeysBtn = By.xpath(`//vscode-button[@data-testid='sort-keys']`)
2424
addDatabaseBtn = By.xpath(`//a[@aria-label='Add Redis database']`)
2525
editDatabaseBtn = By.xpath(`//vscode-button[@data-testid='edit-database']`)
26-
settingsButton = By.xpath(`//a[@aria-label='Open Redis for VS Code settings']`)
26+
settingsButton = By.xpath(
27+
`//a[@aria-label='Open Redis for VS Code settings']`,
28+
)
2729
deleteKeyInListBtn = By.xpath(
2830
`//vscode-button[starts-with(@data-testid, 'remove-key-')]`,
2931
)
@@ -53,7 +55,9 @@ export class TreeView extends WebView {
5355
treeViewVirtualTable = By.xpath(`//*[@data-testid='virtual-tree']/div`)
5456
databaseInstance = By.xpath(`//div[starts-with(@data-testid, 'database-')]`)
5557
keyInFolder = By.xpath(`//*[contains(@data-testid, "keys:")]`)
56-
addKeyFromTreeBtn = By.xpath(`//vscode-button[@data-testid='add-key-from-tree']`)
58+
addKeyFromTreeBtn = By.xpath(
59+
`//vscode-button[@data-testid='add-key-from-tree']`,
60+
)
5761

5862
// mask
5963
keyMask = '//*[@data-testid="key-$name"]'
@@ -88,17 +92,25 @@ export class TreeView extends WebView {
8892
By.xpath(
8993
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/div`,
9094
)
95+
getDatabaseContainerByName = (name: string): Locator =>
96+
By.xpath(
97+
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..`,
98+
)
99+
getLogicalDatabaseContainerByIndex = (name: string, index: number): Locator =>
100+
By.xpath(
101+
`(.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../../div[starts-with(@data-testid, 'logical-database-')])[${index - 1}]`,
102+
)
91103
getEditDatabaseBtnByName = (name: string): Locator =>
92104
By.xpath(
93105
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid='edit-database']`,
94106
)
95107
getRefreshDatabaseBtnByName = (name: string): Locator =>
96108
By.xpath(
97-
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid = 'refresh-keys']`,
109+
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..//button[@data-testid = 'refresh-keys-refresh-btn']`,
98110
)
99111
getCLIDatabaseBtnByName = (name: string): Locator =>
100112
By.xpath(
101-
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid = 'terminal-button']`,
113+
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..//vscode-button[@data-testid = 'terminal-button']`,
102114
)
103115
getKeySelectorByName = (name: string): Locator =>
104116
By.xpath(`//*[@data-testid="key-${name}"]`)

0 commit comments

Comments
 (0)