Skip to content

Commit

Permalink
fix for logical db
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-dargel committed Dec 17, 2024
1 parent 25f718e commit ecfe780
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/e2e/src/page-objects/components/tree-view/TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export class TreeView extends WebView {
sortKeysBtn = By.xpath(`//vscode-button[@data-testid='sort-keys']`)
addDatabaseBtn = By.xpath(`//a[@aria-label='Add Redis database']`)
editDatabaseBtn = By.xpath(`//vscode-button[@data-testid='edit-database']`)
settingsButton = By.xpath(`//a[@aria-label='Open Redis for VS Code settings']`)
settingsButton = By.xpath(
`//a[@aria-label='Open Redis for VS Code settings']`,
)
deleteKeyInListBtn = By.xpath(
`//vscode-button[starts-with(@data-testid, 'remove-key-')]`,
)
Expand Down Expand Up @@ -53,7 +55,9 @@ export class TreeView extends WebView {
treeViewVirtualTable = By.xpath(`//*[@data-testid='virtual-tree']/div`)
databaseInstance = By.xpath(`//div[starts-with(@data-testid, 'database-')]`)
keyInFolder = By.xpath(`//*[contains(@data-testid, "keys:")]`)
addKeyFromTreeBtn = By.xpath(`//vscode-button[@data-testid='add-key-from-tree']`)
addKeyFromTreeBtn = By.xpath(
`//vscode-button[@data-testid='add-key-from-tree']`,
)

// mask
keyMask = '//*[@data-testid="key-$name"]'
Expand Down Expand Up @@ -88,17 +92,25 @@ export class TreeView extends WebView {
By.xpath(
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/div`,
)
getDatabaseContainerByName = (name: string): Locator =>
By.xpath(
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..`,
)
getLogicalDatabaseContainerByIndex = (name: string, index: number): Locator =>
By.xpath(
`(.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../../div[starts-with(@data-testid, 'logical-database-')])[${index - 1}]`,
)
getEditDatabaseBtnByName = (name: string): Locator =>
By.xpath(
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid='edit-database']`,
)
getRefreshDatabaseBtnByName = (name: string): Locator =>
By.xpath(
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid = 'refresh-keys']`,
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..//button[@data-testid = 'refresh-keys-refresh-btn']`,
)
getCLIDatabaseBtnByName = (name: string): Locator =>
By.xpath(
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/..//vscode-button[@data-testid = 'terminal-button']`,
`.//div[starts-with(@data-testid, 'database-')][.//*[text()='${name}']]/../..//vscode-button[@data-testid = 'terminal-button']`,
)
getKeySelectorByName = (name: string): Locator =>
By.xpath(`//*[@data-testid="key-${name}"]`)
Expand Down

0 comments on commit ecfe780

Please sign in to comment.