주기 회기 영속성 대기 고정
This commit is contained in:
parent
fbf29fa40a
commit
9649f5ffaf
1 changed files with 12 additions and 0 deletions
|
|
@ -49,6 +49,7 @@ interface ReturnedPracticeFixture {
|
||||||
interface SessionDetail {
|
interface SessionDetail {
|
||||||
session_id: string;
|
session_id: string;
|
||||||
persona_code: string;
|
persona_code: string;
|
||||||
|
turns?: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AuthMe {
|
interface AuthMe {
|
||||||
|
|
@ -276,10 +277,21 @@ test.describe("periodic same-learner real closed loop", () => {
|
||||||
const stream = await streamResponse;
|
const stream = await streamResponse;
|
||||||
await expectOk(stream);
|
await expectOk(stream);
|
||||||
expect(stream.headers()["content-type"] ?? "").toContain("text/event-stream");
|
expect(stream.headers()["content-type"] ?? "").toContain("text/event-stream");
|
||||||
|
expect(await stream.finished()).toBeNull();
|
||||||
await expect(page.locator(".sx-utt").filter({ hasText: learnerText })).toBeVisible();
|
await expect(page.locator(".sx-utt").filter({ hasText: learnerText })).toBeVisible();
|
||||||
await expect(page.locator(".sx-utt.is-client").last()).toBeVisible({
|
await expect(page.locator(".sx-utt.is-client").last()).toBeVisible({
|
||||||
timeout: 6 * 60_000,
|
timeout: 6 * 60_000,
|
||||||
});
|
});
|
||||||
|
await expect
|
||||||
|
.poll(
|
||||||
|
async () => {
|
||||||
|
const detail = await page.request.get(`/api/sessions/${practiceSessionId}`);
|
||||||
|
if (!detail.ok()) return 0;
|
||||||
|
return ((await detail.json()) as SessionDetail).turns?.length ?? 0;
|
||||||
|
},
|
||||||
|
{ timeout: 60_000, intervals: [500, 1_000, 2_000] },
|
||||||
|
)
|
||||||
|
.toBeGreaterThanOrEqual(2);
|
||||||
|
|
||||||
await page.getByRole("button", { name: "회기 종료" }).click();
|
await page.getByRole("button", { name: "회기 종료" }).click();
|
||||||
await page.getByRole("button", { name: "종료하고 리뷰 보기" }).click();
|
await page.getByRole("button", { name: "종료하고 리뷰 보기" }).click();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue