Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/databricks-vscode-e2e/src/utils/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ export async function getWorkspaceConnectionItem(): Promise<TreeItem | undefined
return undefined;
}

/**
* The workspace row's description, from the DOM rather than the visible text:
* on a selected row, VS Code's inline actions can clip the description out of
* view, and `getDescription()` then returns "".
*/
async function workspaceConnectionDescription(): Promise<string | undefined> {
const item = await getWorkspaceConnectionItem();
return item && String(await item.description$.getProperty("textContent"));
}

/** The PROJECT section's "Local Folder" item, if it points at `folder`. */
export async function getLocalFolderTreeItem(folder: string) {
const section = (await getViewSection("PROJECT")) as CustomTreeSection;
Expand Down Expand Up @@ -105,7 +115,7 @@ export async function waitForLogin(profileName: string) {
let last: string | undefined;
await waitUntilSeen(
async () => {
last = await (await getWorkspaceConnectionItem())?.getDescription();
last = await workspaceConnectionDescription();
return last === profileName || last?.startsWith(`${profileName} · for target `);
},
{
Expand All @@ -128,7 +138,7 @@ export async function waitForWorkspaceConnection(description: string, timeout =
await waitUntilSeen(
async () => {
try {
last = await (await getWorkspaceConnectionItem())?.getDescription();
last = await workspaceConnectionDescription();
error = undefined;
} catch (e) {
last = undefined;
Expand Down
Loading