chat.test.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. // kilocode_change - new file
  2. import { test, type TestFixtures } from "./playwright-base-test"
  3. import {
  4. sendMessage,
  5. waitForWebviewText,
  6. verifyExtensionInstalled,
  7. configureApiKeyThroughUI,
  8. getChatInput,
  9. closeAllToastNotifications,
  10. } from "../helpers"
  11. test.describe("E2E Chat Test", () => {
  12. test("should configure credentials and send a message", async ({ workbox: page, takeScreenshot }: TestFixtures) => {
  13. await verifyExtensionInstalled(page)
  14. await waitForWebviewText(page, "Welcome to Kilo Code!")
  15. await page.waitForTimeout(1000) // Let the page settle to avoid flakes
  16. await closeAllToastNotifications(page)
  17. await takeScreenshot("welcome")
  18. await configureApiKeyThroughUI(page)
  19. await waitForWebviewText(page, "Generate, refactor, and debug code with AI assistance")
  20. await (await getChatInput(page)).focus()
  21. await page.waitForTimeout(1000) // Let the page settle to avoid flakes
  22. await takeScreenshot("ready-to-chat")
  23. // Don't take any more screenshots after the reponse starts-
  24. // llm responses aren't deterministic any capturing the reponse would cause screenshot flakes
  25. await sendMessage(page, "Fill in the blanks for this phrase: 'hello w_r_d'")
  26. await waitForWebviewText(page, "hello world", 30_000)
  27. })
  28. })