chat.test.ts 1.0 KB

12345678910111213141516171819202122232425262728
  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. } from "../helpers"
  10. test.describe("E2E Chat Test", () => {
  11. test("should configure credentials and send a message", async ({ workbox: page, takeScreenshot }: TestFixtures) => {
  12. await verifyExtensionInstalled(page)
  13. await waitForWebviewText(page, "Welcome to Kilo Code!")
  14. await configureApiKeyThroughUI(page)
  15. await waitForWebviewText(page, "Generate, refactor, and debug code with AI assistance")
  16. await page.waitForTimeout(5000) // Let the page settle to avoid flakes
  17. await takeScreenshot("ready-to-chat")
  18. // Don't take any more screenshots after the reponse starts-
  19. // llm responses aren't deterministic any capturing the reponse would cause screenshot flakes
  20. await (await getChatInput(page)).focus()
  21. await sendMessage(page, "Fill in the blanks for this phrase: 'hello w_r_d'")
  22. await waitForWebviewText(page, "hello world", 30_000)
  23. })
  24. })