Skip to content

Commit

Permalink
E2E Test: Detect detached state instead of hidden (#3580)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix authored Mar 27, 2024
1 parent 9c8c47f commit 60fe8a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vscode/test/e2e/chat-atFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ test.extend<ExpectedEvents>({
await page.getByRole('treeitem', { name: 'buzz.ts' }).locator('a').dblclick()
await page.getByRole('tab', { name: 'buzz.ts' }).click()

// Wait for the tsserver to become ready: when loading status disappears
await expect(page.getByRole('button', { name: 'Editor Language Status: Loading' })).toBeVisible()
await page.waitForSelector('button[aria-label="Editor Language Status: Loading"]', {
state: 'hidden',
})
// Wait for the tsserver to become ready: when sync icon disappears
const langServerLoadingState = 'Editor Language Status: Loading'
await expect(page.getByRole('button', { name: langServerLoadingState })).toBeVisible()
await page.waitForSelector(`span[class*="codicon codicon-sync"]`, { state: 'detached' })
await expect(page.getByRole('button', { name: langServerLoadingState })).not.toBeVisible()

// Go back to the Cody chat tab
await page.getByRole('tab', { name: 'New Chat' }).click()
Expand All @@ -322,7 +322,7 @@ test.extend<ExpectedEvents>({

// Clicking on a file in the selector should autocomplete the file in chat input with added space
await chatInput.clear()
await chatInput.pressSequentially('@#fizzb', { delay: 10 })
await chatInput.pressSequentially('@#fizzb', { delay: 200 })
await expect(chatPanelFrame.getByRole('option', { name: 'fizzbuzz()' })).toBeVisible()
await chatPanelFrame.getByRole('option', { name: 'fizzbuzz()' }).click()
await expect(chatInput).toHaveText('@buzz.ts:1-15#fizzbuzz() ')
Expand Down

0 comments on commit 60fe8a8

Please sign in to comment.