test(ldd): конкурентность, нагрузка и release gate

This commit is contained in:
2026-10-28 00:40:08 +03:00
parent 05f628a52b
commit 85d34e78cb
7 changed files with 395 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ type Seeded = {
courseNo: number;
courseTitle: string;
groupId: string;
labId: string;
groupName: string;
studentFullName: string;
studentLogin: string;
@@ -102,7 +103,7 @@ test.beforeAll(async ({ playwright }) => {
await createWithToken(api, adminToken, "post", `/api/v1/courses/${course.id}/groups`, {
groupId: group.id,
});
await createWithToken(api, adminToken, "post", "/api/v1/labs", {
const lab = await createWithToken(api, adminToken, "post", "/api/v1/labs", {
number: 1,
title: "E2E Lab",
status: "published",
@@ -126,6 +127,7 @@ test.beforeAll(async ({ playwright }) => {
courseTitle: String(course.title),
groupId: String(group.id),
groupName: String(group.name),
labId: String(lab.id),
studentFullName: String(student.fullName),
studentLogin: studentNo,
studentPassword: "e2e-student-456",
@@ -186,3 +188,19 @@ test("anonymous and student cannot reach admin pages", async ({ page }) => {
await page.goto(`/learn/course/${seeded.courseNo}`);
await expect(page.locator("body")).toContainText(seeded.courseTitle);
});
test("student submits a solution and mobile teacher page renders", async ({ page }) => {
await login(page, seeded.studentLogin, seeded.studentPassword, "**/student");
await page.goto(`/student/labs/${seeded.labId}`);
await page.setInputFiles('input[name="files"]', "fixtures/main.c");
await page.getByRole("button", { name: "Отправить решение" }).click();
await expect(page.locator("body")).toContainText("Решение отправлено");
await expect(page.locator("body")).toContainText("main.c");
await page.context().clearCookies();
await page.setViewportSize({ width: 390, height: 844 });
await login(page, seeded.teacherLogin, seeded.teacherPassword, "**/teacher");
await page.goto(`/teacher/courses/${seeded.courseId}`);
await expect(page.locator("h1")).toContainText(seeded.courseTitle);
await expect(page.locator("body")).toContainText(seeded.groupName);
});