diff --git a/tests/e2e/src/helpers/api/KeyApi.ts b/tests/e2e/src/helpers/api/KeyApi.ts index 07e12616..a279d80e 100644 --- a/tests/e2e/src/helpers/api/KeyApi.ts +++ b/tests/e2e/src/helpers/api/KeyApi.ts @@ -148,6 +148,7 @@ export class KeyAPIRequests { const databaseId = await DatabaseAPIRequests.getDatabaseIdByName(databaseName) const requestBody = { + destination: "TAIL", keyName: Buffer.from(keyParameters.keyName, 'utf-8'), elements: keyParameters.element.map(el => Buffer.from(el, 'utf-8')) } diff --git a/tests/e2e/src/page-objects/components/editor-view/KeyDetailsView.ts b/tests/e2e/src/page-objects/components/editor-view/KeyDetailsView.ts index dd3bd8a8..857fe54e 100644 --- a/tests/e2e/src/page-objects/components/editor-view/KeyDetailsView.ts +++ b/tests/e2e/src/page-objects/components/editor-view/KeyDetailsView.ts @@ -37,7 +37,7 @@ export class KeyDetailsView extends WebView { `//vscode-button[starts-with(@data-testid, 'copy-name-button')]`, ) detailsDeleteKeyButton = By.xpath( - `//vscode-button[starts-with(@data-testid, 'remove-key-')]`, + `//button[starts-with(@data-testid, 'remove-key-')]`, ) submitDetailsDeleteKeyButton = By.xpath( `//div[@class='popup-content ']//vscode-button[starts-with(@data-testid, 'remove-key-')]`, diff --git a/tests/e2e/src/page-objects/components/tree-view/TreeView.ts b/tests/e2e/src/page-objects/components/tree-view/TreeView.ts index 8b7ab636..8d799a3f 100644 --- a/tests/e2e/src/page-objects/components/tree-view/TreeView.ts +++ b/tests/e2e/src/page-objects/components/tree-view/TreeView.ts @@ -23,9 +23,11 @@ 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-')]`, + `//button[starts-with(@data-testid, 'remove-key-')]`, ) submitDeleteKeyButton = By.xpath( `//div[@class='popup-content ']//vscode-button[starts-with(@data-testid, 'remove-key-')]`, @@ -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"]' @@ -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}"]`)