[ENHANCEMENT] [MER-5443] Add Playwright delivery coverage for file upload, likert, and directed discussion#6720
Conversation
…automation tsconfig
AI Review —Readiness locator can match unrelated course contentfile: assets/automation/src/systems/torus/pom/course/StudentCoursePO.ts Storage coverage is disabled by a test-only environment flagfile: assets/automation/tests/torus/student_delivery/file-upload-delivery.spec.ts |
…fix instant-snapshot race)
…file-upload-likert-and-discussion-style-activity-delivery-coverage-including-any-directive-expansion-needed-for-scenario-driven-learner-interaction-and-assertion-support-playwright
…file-upload-likert-and-discussion-style-activity-delivery-coverage-including-any-directive-expansion-needed-for-scenario-driven-learner-interaction-and-assertion-support-playwright # Conflicts: # assets/automation/src/systems/torus/pom/course/StudentCoursePO.ts # assets/automation/tests/torus/student_delivery/support/common.ts # assets/automation/tests/torus/student_delivery/support/index.ts
Ticket: MER-5443
Summary
Adds Playwright learner-delivery coverage for three activity types that had weak or no browser automation — file upload, likert, and directed discussion — following the Lane 4 pattern established by MER-5438/MER-5440 and the sibling MER-5446 (PR #6712).
Also included:
student_deliverysupport.tsinto asupport/folder (matches the [ENHANCEMENT] [MER-5446] Add delivery automation coverage for activities #6712 convention), with a per-activity helper module each.tsconfig.jsontooling fix (addsnodetypes, drops deprecatedbaseUrlin favour of relativepaths).What's covered
Each activity is seeded server-side via
Oli.ScenariosYAML (structure only), then the learner interaction is driven in the browser — no authoring/section UI is exercised (that's covered by other lanes).oli_likertoli_file_uploadoli_directed_discussionThe full case matrix and rationale live in
docs/exec-plans/current/epics/automated_testing/mer-5443-delivery-plan.md.Implementation notes
create_activity(JSON model), placed viaedit_page, published, one section per attempt-isolated variant.test.stepgrouping — related assertions grouped per test to pay the login/nav cost once.F1/F4) require an object-storage backend, so they are gated behindSTORAGE_TESTS. The storage-free negatives (oversize, submit-gating) always run. See follow-ups.itemsrequirement — likert delivery renders frommodel.items; the seed includesitemswith the part id aligned to the item id (per the likert default model). The shared reference fixture was missing this and is fixed here.StudentCoursePO.openPageand the sharedopenStudentDeliveryPracticeForLoggedInStudenthelper previously branched on an instantisVisible({ timeout })snapshot (Playwright ignores that timeout), which could misroute under slow rendering. They now wait for whichever target appears via a newcourseContentReady()accessor (galleryTitle.or(outlineTitle)) before branching. Addresses the two CI navigation-race findings flagged on this PR.Coordination with #6712
The
support/scaffolding andStudentCoursePOchanges overlap with the sibling PR #6712 (draft). TwoStudentCoursePOitems:openPage— this branch changes it (the navigation-readiness race fix +courseContentReady()accessor above). [ENHANCEMENT] [MER-5446] Add delivery automation coverage for activities #6712 concurrently tightens the same function's outline matcher (button-contains-exact-title). The two changes compose — this branch's.or(outlineTitle)uses whateveroutlineTitleresolves to — so the reconciliation is to keep both (our readiness wait + their matcher), not pick one.findVisibleCourseHomepoll loop — left as a standalone follow-up per [ENHANCEMENT] [MER-5446] Add delivery automation coverage for activities #6712's author: TRIAGE-2411.Validation
prettier --checkandeslintclean across all added specs/helpers,StudentCoursePO.ts, andtsconfig.json.F1/F4run where storage is available.)mix test test/scenarios/activities/activities_test.exs→ 11 tests, 0 failures (reference-fixture change).expect(...).toBeVisible()(10s) rather than misrouting silently.Follow-ups
student_deliveryspecs (boots Torus + storage). Today no workflow runs these specs; this also enables theSTORAGE_TESTS-gated file-upload tests.token=undefined; does not affect single-user posting (REST-backed).StudentCoursePO.findVisibleCourseHomeoff manual polling to native auto-wait (shared nav helper; trace-noise/robustness).openPagematcher cleanup — handled in [ENHANCEMENT] [MER-5446] Add delivery automation coverage for activities #6712.