feat(frontend): redesign the candidate cabinet with step-by-step profile and questionnaire forms
This commit is contained in:
1 parent
15590d127c
commit
c836d02ea3
77 files changed
+5409
-1618
No files matched your search
@@ -131,11 +131,18 @@ async function grantC3(page: Page): Promise<void> {
|
||||
async function saveAssessmentQuestionnaire(page: Page): Promise<void> {
|
||||
await page.goto("/candidate/questionnaire");
|
||||
await expect(page.getByRole("heading", { name: "Ответы кандидата" })).toBeVisible();
|
||||
// The questionnaire is a form in steps; "Далее" moves the focus to the next heading.
|
||||
await page.getByLabel("Специализация", { exact: true }).selectOption("backend");
|
||||
await page.getByRole("button", { name: "Далее", exact: true }).click();
|
||||
await expect(page.getByRole("heading", { name: /\. Уровень и опыт$/ })).toBeFocused();
|
||||
await page.getByLabel("Моя оценка уровня").selectOption("junior");
|
||||
await page.getByRole("checkbox", { name: "Go", exact: true }).check();
|
||||
await page.getByRole("checkbox", { name: "Python", exact: true }).check();
|
||||
await page.getByRole("button", { name: "Далее", exact: true }).click();
|
||||
await expect(page.getByRole("heading", { name: /\. Формат работы$/ })).toBeFocused();
|
||||
await page.getByRole("checkbox", { name: "Удаленно", exact: true }).check();
|
||||
await page.getByRole("button", { name: "Далее", exact: true }).click();
|
||||
await expect(page.getByRole("heading", { name: /\. Проверка и сохранение$/ })).toBeFocused();
|
||||
const response = page.waitForResponse(
|
||||
(item) =>
|
||||
item.request().method() === "PUT" &&
|
||||
@@ -369,6 +376,31 @@ test("candidate can review, resume, and finish separate assessment modes", async
|
||||
const firstExpressSnapshot = (await startExpressResponse.json()) as AttemptSnapshot;
|
||||
expect(firstExpressSnapshot.current_item?.id).toBeTruthy();
|
||||
|
||||
// An unfinished express run is resumed: after a full reload of the
|
||||
// assessment page, a new start answers 409, and the page replays the start
|
||||
// with the key stored in this tab, which returns the stored 201 of the run.
|
||||
await page.goto("/candidate/assessment");
|
||||
await expect(page.getByRole("button", { name: "Начать демонстрацию" })).toBeVisible();
|
||||
const expressStarts: { status: number; key: string | null }[] = [];
|
||||
const recordExpressStart = (response: Response) => {
|
||||
if (
|
||||
response.request().method() === "POST" &&
|
||||
new URL(response.url()).pathname === "/api/v1/me/assessment-attempts"
|
||||
) {
|
||||
expressStarts.push({
|
||||
status: response.status(),
|
||||
key: response.request().headers()["idempotency-key"] ?? null,
|
||||
});
|
||||
}
|
||||
};
|
||||
page.on("response", recordExpressStart);
|
||||
await page.getByRole("button", { name: "Начать демонстрацию" }).click();
|
||||
await expect(page).toHaveURL(new RegExp(`/candidate/assessment/${expressAttempt.id}$`));
|
||||
await expect(page.getByText("Незавершенная демонстрация продолжена")).toBeVisible();
|
||||
page.off("response", recordExpressStart);
|
||||
expect(expressStarts.map((start) => start.status)).toEqual([409, 201]);
|
||||
expect(expressStarts[0]?.key).not.toBe(expressStarts[1]?.key);
|
||||
|
||||
await navigateInApp(page, `/candidate/assessment/${realAttempt.id}`);
|
||||
await expect(page.getByRole("heading", { name: "Результат с сервера" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Начать или продолжить" })).toHaveCount(0);
|
||||
|
||||
Reference in new issue
Block a user