-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: record and replay streaming LLM calls in e2e tests #149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
2175477
to
4343f23
Compare
Playwright e2e testsTo view traces locally, unzip the report and run: npx playwright show-report ~/Downloads/playwright-report |
f7609b5
to
a4f487e
Compare
2c6f4a6
to
31146cb
Compare
31146cb
to
f85f237
Compare
await page.waitForURL(/\/aila\/.+/); | ||
await waitForGeneration(page, generationTimeout); | ||
await expectSectionsComplete(page, 1); | ||
await page.waitForTimeout(500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These waits are an antipattern. If we don't allow enough time before sending the next message, the completed section count goes backwards. I think it's a race condition with the useEffects in the chat and fetching state from tRPC after streaming. It was happening before and after #147
await test.step("Go to downloads page", async () => { | ||
// Open 'download resources' menu | ||
const downloadResources = page.getByTestId("chat-download-resources"); | ||
await downloadResources.click(); | ||
page.waitForURL(/\aila\/.*\/download/); | ||
|
||
// Click to download lesson plan | ||
const downloadLessonPlan = page.getByTestId("chat-download-lesson-plan"); | ||
await downloadLessonPlan.click(); | ||
|
||
// Skip feedback form | ||
await page.getByLabel("Skip").click(); | ||
page.getByRole("heading", { name: "Download resources" }); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about this too much, as I'm putting together a new PR to split it out into a separate test
76b026d
to
ba70c21
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant!
Description
This PR supersedes #130, as that PR didn't mock the moderation OpenAI calls
/chat
and addsx-fixture-name
andx-fixture-mode
headersKnown issues:
How to test
AILA_FIXTURES_ENABLED=true
in.env
pnpm run test-e2e-ui
.formatted.txt
files to confirm