Skip to content

test(intern-21): E2E upload → convert → preview (#359) - #396

Open
CodingMinh wants to merge 4 commits into
masterfrom
intern/21-e2e-test-basics
Open

test(intern-21): E2E upload → convert → preview (#359)#396
CodingMinh wants to merge 4 commits into
masterfrom
intern/21-e2e-test-basics

Conversation

@CodingMinh

Copy link
Copy Markdown
Collaborator

Summary

  • Thêm spec Playwright mock-mode web/e2e/intern-upload-convert.spec.ts cho happy path upload → convert → preview (intern-21 / Closes [intern-21] E2E test basics: Playwright web conversion flow #359).
  • Given user đã đăng nhập và mở collection Employee Handbook, When chọn file .txt và upload xong, Then UI hiện tiến trình/chuyển đổi, job thành công, document xuất hiện trong bảng, preview markdown hiện nội dung mock.
  • Upload dùng page.route('**/api/v1/uploads') vì client gửi qua XMLHttpRequest (không qua fetch-mock) — replay qua in-page mock giống upload.spec.ts.

Page object / locators

Repo này không dùng class-based POM; dùng helpers chung trong web/e2e/support.ts (login, openEmployeeHandbook, succeedUploadJob, advanceDocument) + Playwright locators:

  • getByRole (progressbar, table, button)
  • getByLabel (file input)
  • getByTestId('document-preview-markdown')

Assertions

  • expect(...).toBeVisible() — progress bar, trạng thái "Đang chuyển đổi", message "Đã chuyển đổi sang Markdown…"
  • expect(...).toContainText('Mock preview content for version') — preview markdown (mock không trả bytes file upload thật)
  • Không dùng sleep() — chỉ expect(..., { timeout }) polling

Test plan

  • pnpm --dir web exec playwright test e2e/intern-upload-convert.spec.ts
  • pnpm --dir web e2e — 39 passed (mock suite)

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
anhnth24 and others added 2 commits August 7, 2026 10:07
On case-insensitive volumes, citationFootnotes.ts collided with
CitationFootnotes.tsx and broke mock-mode Playwright login. Add
INTERN-359 evidence doc and drop arbitrary sleep in intern upload spec.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor
cursor Bot requested a review from Supermonters August 10, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[intern-21] E2E test basics: Playwright web conversion flow

3 participants