diff --git a/vscode/extension/tests/bad_setup.spec.ts b/vscode/extension/tests/bad_setup.spec.ts index 3f715e525a..b76eee2b3d 100644 --- a/vscode/extension/tests/bad_setup.spec.ts +++ b/vscode/extension/tests/bad_setup.spec.ts @@ -91,7 +91,7 @@ test('lineage, no sqlmesh found', async ({ // Checks that if you have another file open like somewhere else, it still checks the workspace first for a successful context // it's very flaky but runs when debugging // - the typing in of the file name is very flaky -test.skip('check that the LSP runs correctly by opening lineage when looking at another file before not in workspace', async ({ +test('check that the LSP runs correctly by opening lineage when looking at another file before not in workspace', async ({ page, sharedCodeServer, tempDir, diff --git a/vscode/extension/tests/utils.ts b/vscode/extension/tests/utils.ts index d75036b0ef..8aecae2f46 100644 --- a/vscode/extension/tests/utils.ts +++ b/vscode/extension/tests/utils.ts @@ -175,17 +175,19 @@ export const openFile = async (page: Page, file: string): Promise => { const maxRetries = 3 const retryDelay = 3000 + const fileName = path.basename(file) + for (let attempt = 0; attempt < maxRetries; attempt++) { try { await page.keyboard.press( process.platform === 'darwin' ? 'Meta+P' : 'Control+P', ) - await page.waitForSelector('input[aria-label="Search files by name"]', { - timeout: 5000, - }) + await page + .getByRole('textbox', { name: 'Search files by name' }) + .waitFor({ state: 'visible', timeout: 5000 }) await page.keyboard.type(file) const commandElement = await page.waitForSelector( - `a:has-text("${file}")`, + `a:has-text("${fileName}")`, { timeout: 5000 }, ) await commandElement.click()