@@ -23,9 +23,11 @@ export class TreeView extends WebView {
23
23
sortKeysBtn = By . xpath ( `//vscode-button[@data-testid='sort-keys']` )
24
24
addDatabaseBtn = By . xpath ( `//a[@aria-label='Add Redis database']` )
25
25
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
+ )
27
29
deleteKeyInListBtn = By . xpath (
28
- `//vscode- button[starts-with(@data-testid, 'remove-key-')]` ,
30
+ `//button[starts-with(@data-testid, 'remove-key-')]` ,
29
31
)
30
32
submitDeleteKeyButton = By . xpath (
31
33
`//div[@class='popup-content ']//vscode-button[starts-with(@data-testid, 'remove-key-')]` ,
@@ -53,7 +55,9 @@ export class TreeView extends WebView {
53
55
treeViewVirtualTable = By . xpath ( `//*[@data-testid='virtual-tree']/div` )
54
56
databaseInstance = By . xpath ( `//div[starts-with(@data-testid, 'database-')]` )
55
57
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
+ )
57
61
58
62
// mask
59
63
keyMask = '//*[@data-testid="key-$name"]'
@@ -88,17 +92,25 @@ export class TreeView extends WebView {
88
92
By . xpath (
89
93
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${ name } ']]/div` ,
90
94
)
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
+ )
91
103
getEditDatabaseBtnByName = ( name : string ) : Locator =>
92
104
By . xpath (
93
105
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${ name } ']]/..//vscode-button[@data-testid='edit-database']` ,
94
106
)
95
107
getRefreshDatabaseBtnByName = ( name : string ) : Locator =>
96
108
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 ']` ,
98
110
)
99
111
getCLIDatabaseBtnByName = ( name : string ) : Locator =>
100
112
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']` ,
102
114
)
103
115
getKeySelectorByName = ( name : string ) : Locator =>
104
116
By . xpath ( `//*[@data-testid="key-${ name } "]` )
0 commit comments