lmsiq
v0.2.2
Published
LmsIQ — Moodle-aware UI regression testing CLI (Playwright)
Maintainers
Readme
LmsIQ
Moodle regression testing, done with intent.
LmsIQ is a semantic automation platform for standard Moodle workflows. It lets teams validate that core Moodle behaviour — course management, user enrolment, activity completion, SCORM, quizzes, assignments — still works correctly after upgrades, theme changes, or configuration updates.
Workflows are written in plain YAML using Moodle-native verbs (openCourse, completeScorm, verifyActivityCompleted), not raw browser selectors. The Playwright layer is an implementation detail; your regression suite reads like a Moodle task list.
Install
npm install -g lmsiq
npx playwright install chromiumOr use in a project:
npm install lmsiq
npx lmsiq --helpQuick start
lmsiq init
# Edit .env with your Moodle URL and credentials
lmsiq doctor
lmsiq run --workflow tests/workflows/student-page.yamlFor local development from this repo:
npm install
npm run build
npm link
lmsiq run --workflow tests/workflows/student-page.yamlScan a Moodle plugin (PHP → accurate tests)
LmsIQ reads your plugin's PHP source — version.php, lang strings, Mustache templates, moodleform classes, and page URLs — and builds a real description for test generation. No guessing field names or labels.
cd /path/to/moodle
lmsiq scan --plugin local/myplugin
lmsiq scan --plugin local/myplugin --generate --provider googleOn Git Bash, prefer local/myplugin (no leading slash) or pass --moodle /c/path/to/moodle.
AI test generation
lmsiq generate --init
lmsiq generate --from lmsiq-plugin.yaml
lmsiq generate --prompt "Course booking plugin for Moodle..."
lmsiq generate --interactive --provider googleCombine with scan for the most accurate output:
lmsiq scan --plugin local/myplugin --generate --provider googlePre-built workflows (run after lmsiq init)
These ship with LmsIQ and are ready to run once .env is configured:
Activities
lmsiq run --workflow tests/workflows/student-page.yaml
lmsiq run --workflow tests/workflows/student-scorm.yaml
lmsiq run --workflow tests/workflows/student-submit-assignment.yaml
lmsiq run --workflow tests/workflows/student-attempt-quiz.yaml
lmsiq run --workflow tests/workflows/teacher-assignment.yamlAdmin
lmsiq run --workflow tests/workflows/admin-create-course.yaml
lmsiq run --workflow tests/workflows/admin-create-user.yamlRole-based access
lmsiq run --workflow tests/workflows/core/roles/student-cannot-access-admin.yaml
lmsiq run --workflow tests/workflows/core/roles/admin-can-access-admin.yaml
lmsiq run --workflow tests/workflows/core/roles/teacher-access-scope.yamlExample workflow
id: student-scorm
name: Student completes SCORM activity
steps:
- action: loginAs
role: student
- action: openCourse
course: "${MOODLE_SCORM_COURSE_NAME}"
- action: completeScorm
activity: "${MOODLE_SCORM_ACTIVITY_NAME}"
- action: verifyActivityCompleted
activity: "${MOODLE_SCORM_ACTIVITY_NAME}"
- action: logoutCore action catalog (Phase 1)
| Domain | Actions |
|--------|---------|
| Auth | loginAs, logout, verifyLoggedIn |
| Courses | openCourse, createCourse, verifyCourseVisible |
| Users | createUser, enrolUser, verifyUserEnrolled |
| Activities | openActivity, createPage, createAssignment, createQuiz, createScorm |
| Completion | completePage, completeScorm, submitAssignment, attemptQuiz, verifyActivityCompleted |
| Admin | createCategory |
Recording assistant
Speed up workflow discovery on any Moodle site:
lmsiq record --name my-workflowLmsIQ opens a headed browser, watches your navigation, and writes a draft YAML when you press Enter. The draft uses Core semantic steps — always review before committing.
Custom workflows
Custom or organisation-specific workflows (proprietary plugins, custom dashboards, tenant navigation) belong in tests/workflows/company/ and are built on top of Core actions. See Company validation suite for examples.
Documentation
| Doc | Purpose |
|-----|---------|
| Product architecture | Core vs Custom layer boundary, Phase 1 scope, strategic rationale |
| Moodle semantic actions | Action design principles, code layout, activity priority tiers |
| Writing workflows | YAML contract, .env variables, supported actions, runner output |
| Company validation suite | Customised Moodle smoke suite example |
Requirements
- Node.js 18+
- Playwright (
npx playwright install chromium) - Moodle 5.x (5.0 and above)
Source & support
LmsIQ is distributed on npm under the MIT licence. Documentation ships inside the package (docs/ after install). For questions or issues, contact [email protected].
