mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-10-10 03:56:39 +01:00
Avoid opening tab path tooltips during automatic focus (#2601)
* Prevent tab tooltips opening on automatic focus * Target expand icons in E2E tree navigation
This commit is contained in:
+4
-3
@@ -118,6 +118,7 @@ function tryGetStandardName(accountType: TestAccount) {
|
||||
: `${process.env.DE_TEST_ACCOUNT_PREFIX}-`;
|
||||
return `${actualPrefix}${accountType.toLocaleLowerCase()}`;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Maps a base API account type to its dedicated connection string (account key) account.
|
||||
@@ -328,12 +329,12 @@ class TreeNode {
|
||||
async expand(): Promise<void> {
|
||||
const treeNodeContainer = this.frame.getByTestId(`TreeNodeContainer:${this.id}`);
|
||||
const tree = this.frame.getByTestId(`Tree:${this.id}`);
|
||||
const expandIcon = this.element.locator(":scope > .fui-TreeItemLayout__expandIcon");
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
const expandNode = async () => {
|
||||
if ((await treeNodeContainer.getAttribute("aria-expanded")) !== "true") {
|
||||
// Click the node, to trigger loading and expansion
|
||||
await this.element.click();
|
||||
await expandIcon.click();
|
||||
}
|
||||
|
||||
// Try three times to wait for the node to expand.
|
||||
@@ -346,7 +347,7 @@ class TreeNode {
|
||||
// Just try again
|
||||
if ((await treeNodeContainer.getAttribute("aria-expanded")) !== "true") {
|
||||
// We might have collapsed the node, try expanding it again, then retry.
|
||||
await this.element.click();
|
||||
await expandIcon.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
|
||||
import { CommandBarButton, DataExplorer, TestAccount } from "../fx";
|
||||
import { CommandBarButton, DataExplorer, generateUniqueName, TestAccount } from "../fx";
|
||||
import { createTestSQLContainer, TestContainerContext } from "../testData";
|
||||
|
||||
// Test container context for setup and cleanup
|
||||
@@ -10,7 +10,10 @@ let CONTAINER_ID: string;
|
||||
|
||||
// Set up test database and container with data before all tests
|
||||
test.beforeAll(async () => {
|
||||
testContainer = await createTestSQLContainer({ includeTestData: true });
|
||||
testContainer = await createTestSQLContainer({
|
||||
includeTestData: true,
|
||||
databaseName: generateUniqueName("db_tab_tooltip_with_a_long_resource_name"),
|
||||
});
|
||||
DATABASE_ID = testContainer.database.id;
|
||||
CONTAINER_ID = testContainer.container.id;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user