Conversation
WalkthroughThis update standardizes the import paths across our system tests. All relative paths for utility modules (such as those for screenshots, course actions, iframe locators, and notifications) have been replaced with absolute paths using the Changes
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
system-tests/src/tests/api/langs.spec.tsOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from /eslint.config.js system-tests/src/tests/admin/playground.spec.tsOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from /eslint.config.js system-tests/src/tests/admin/exercise-service.spec.tsOops! Something went wrong! :( ESLint: 9.20.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from /eslint.config.js
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (3)
system-tests/src/tests/course-features/cheating-detection/manage.spec.ts (1)
70-73:⚠️ Potential issueCorrect Verification of Student 3's Results
The test step intended to validate student 3’s results is mistakenly checkingstudent2Pageon lines 72–73. Please update these references so that they verifystudent3Pageinstead.
For example, consider applying this diff:- await expect(student2Page.getByTestId("exercise-points")).toContainText("1/1") - await student2Page.getByText("Good job!").waitFor() + await expect(student3Page.getByTestId("exercise-points")).toContainText("1/1") + await student3Page.getByText("Good job!").waitFor()system-tests/src/tests/pages/pages/history.spec.ts (1)
64-66: 💡 Verification agent❓ Verification inconclusive
Ensure Backend Mutation Confirmation
The test callssaveCMSPage(page)to trigger a backend mutation but does not explicitly wait for a clear confirmation element (such as a success message). It may be beneficial to verify within or immediately after the save routine that the UI reflects a successful save before proceeding.
Enhance Verification of Page Save Confirmation
After calling
await saveCMSPage(page), please add a step that explicitly waits for a clear confirmation (such as a success message or a UI indication of the mutation success) before proceeding. This change will ensure that the backend mutation has been fully processed and reflected in the UI, preventing intermittent test failures.
- File:
system-tests/src/tests/pages/pages/history.spec.ts- Location: Lines 64-66 (immediately after
await saveCMSPage(page))- Suggestion: Insert an explicit confirmation check (e.g., wait for a success toast or a UI element that signals a successful save) right after the save routine.
system-tests/src/tests/exercises/quizzes/create-and-save-quizzes.spec.ts (1)
398-465: 💡 Verification agent❓ Verification inconclusive
Ensure Robust Backend Mutation Confirmation
In the "Create quizzes in page" test, the final save operation is performed by clicking the Save button (line 464). However, there is no explicit check (e.g., a success notification) to confirm that the backend mutation completed. Adding a UI confirmation element check after saving could prevent potential race conditions.
Action Required: Add Explicit Backend Confirmation Check
- In the "Create quizzes in page" test (file:
system-tests/src/tests/exercises/quizzes/create-and-save-quizzes.spec.ts, lines 398–465), the final operation is simply clicking the Save button (line 464) with no subsequent verification.- To avoid potential race conditions, please add a UI confirmation (for example, checking for a success notification) after the Save click.
- A suggested pattern is as follows:
await page.click(`button:text-is("Save") >> visible=true`) await expect(page.locator('.notification-success')).toBeVisible({ timeout: 5000 })
🧹 Nitpick comments (11)
system-tests/src/tests/exercises/management/list.spec.ts (1)
9-17: Suggestion: Consider Handling Course Instance Prompts
This test navigates to a course page (via the "Manage course 'Advanced exercise states'" link). If a course selection dialog appears in this flow, please ensure that theselectCourseInstanceIfPromptedfunction is invoked to wait for the appropriate UI confirmation before proceeding.system-tests/src/tests/course-management/modules/manage.spec.ts (1)
32-33: Consider Explicit Wait for Deletion Confirmation
After triggering the module deletion on line 33, the test immediately takes a screenshot (line 34) without explicitly waiting for a UI confirmation (such as a toast or dialog). Although the snapshot may capture the post-deletion state, adding an explicit wait for a confirmation element—if available—could improve test stability.system-tests/src/tests/course-management/instances/course-instance-management.spec.ts (1)
70-78: Clarify Toast Notification Handling (Nitpick)
The test toggles toast notification behavior usingshowNextToastsInfinitely(page)and latershowToastsNormally(page). While this is functionally acceptable, consider adding a brief inline comment to explain why this toggling is necessary for the test flow. This will aid future maintainers in understanding the context behind these function calls.system-tests/src/tests/course-material/rendering/content-components.spec.ts (1)
30-30: Address TODO Comment for Screenshot Options
A TODO comment regarding theaxeSkipconfiguration is still present. Please review and either remove or update it when appropriate.system-tests/src/tests/course-features/cheating-detection/manage.spec.ts (1)
44-49: Ensure UI Confirmation After Backend Mutation
After the teacher fills in the "Points" and "Duration" fields and clicks "Set threshold", there is no explicit wait for a UI confirmation element (such as an "Operation successful" message). Adding such a wait would help ensure that the backend update has fully completed before proceeding with subsequent actions.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-long-text.spec.ts (1)
13-36: Review of Interaction Steps and Potential Duplicate Click
The test navigates to the correct quiz option and interacts with the iframe as expected. However, note that the locator for"short answer"is clicked twice (lines 25 and 27). Please verify whether this is intentional—for instance, to simulate a multi-selection—or if it might be a redundant action.system-tests/src/tests/exams/exam-instructions.spec.ts (1)
52-56: Avoid Fixed Timeout for Backend Mutation Confirmation
After clicking "Save" (line 52), the test usespage.waitForTimeout(200)to provide a delay. Instead of a fixed timeout, consider waiting for a clear UI confirmation element that indicates the exam instructions have been successfully saved. This will make the test more robust against timing fluctuations. For example:- // eslint-disable-next-line playwright/no-wait-for-timeout - await page.waitForTimeout(200) + await page.getByText("Saved successfully").waitFor({ timeout: 5000 })If a UI confirmation element is not present, it is recommended to update the application to expose one.
system-tests/src/tests/course-features/research-form/manage.spec.ts (1)
47-56: Implicit Confirmation via Screenshot Stabilization
The test for “Research form is shown on a coursepage if not answered” leverages screenshot snapshot comparisons to verify that the research form renders appropriately. While this is a creative approach, ensure that snapshot matching is sufficiently reliable across environments.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-column.spec.ts (1)
78-78: Suggestion: Standardize Frame Selection.
The test usespage.frameLocator("iframe")on line 78 to click the second option, whereas a saved frame reference fromgetLocatorForNthExerciseServiceIframeis used elsewhere. For consistency and future maintainability, consider using the dedicated helper function throughout the test.system-tests/src/tests/exercises/peer-reviews/manual-review-everything.spec.ts (1)
80-88: Consider Handling Course Instance Prompts
When navigating to course pages (for instance, when clicking “Navigate to course 'Peer review Course'”), if a dialog or prompt appears, consider using theselectCourseInstanceIfPromptedhelper for consistency with our guidelines.system-tests/src/tests/exercises/peer-reviews/automatically-grade-or-manual-review-by-average.spec.ts (1)
90-95: Optional Enhancement: Handle Course Navigation Prompts
If navigating to course pages results in a prompt or dialog, consider integrating theselectCourseInstanceIfPromptedfunction. This would standardize the flow and ensure that any modal prompts are properly addressed before proceeding.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
system-tests/src/tests/course-management/instances/add-completions.spec.ts-snapshots/manual-completion-after-posting-completions-small-desktop-chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (83)
system-tests/src/tests/admin/exercise-service.spec.ts(1 hunks)system-tests/src/tests/admin/playground.spec.ts(1 hunks)system-tests/src/tests/api/langs.spec.ts(1 hunks)system-tests/src/tests/authentication/login.spec.ts(1 hunks)system-tests/src/tests/authentication/research-consent.spec.ts(1 hunks)system-tests/src/tests/course-features/certificates/configure-certificate.spec.ts(1 hunks)system-tests/src/tests/course-features/certificates/generate-certificate.spec.ts(1 hunks)system-tests/src/tests/course-features/cheating-detection/manage.spec.ts(1 hunks)system-tests/src/tests/course-features/feedback/give-and-manage.spec.ts(1 hunks)system-tests/src/tests/course-features/feedback/proposed-edits.spec.ts(1 hunks)system-tests/src/tests/course-features/glossary/manage.spec.ts(1 hunks)system-tests/src/tests/course-features/glossary/tooltip.spec.ts(1 hunks)system-tests/src/tests/course-features/references/manage.spec.ts(1 hunks)system-tests/src/tests/course-features/research-form/manage.spec.ts(1 hunks)system-tests/src/tests/course-features/search/content-search.spec.ts(1 hunks)system-tests/src/tests/course-management/creation/create-course-with-exercise.spec.ts(1 hunks)system-tests/src/tests/course-management/instances/add-completions.spec.ts(1 hunks)system-tests/src/tests/course-management/instances/course-instance-management.spec.ts(1 hunks)system-tests/src/tests/course-management/language/change-user-preference.spec.ts(1 hunks)system-tests/src/tests/course-management/language/versions.spec.ts(1 hunks)system-tests/src/tests/course-management/modules/manage.spec.ts(1 hunks)system-tests/src/tests/course-management/permissions/manage.spec.ts(1 hunks)system-tests/src/tests/course-management/progress/reset.spec.ts(1 hunks)system-tests/src/tests/course-management/status/draft.spec.ts(1 hunks)system-tests/src/tests/course-material/blocks/audio.spec.ts(1 hunks)system-tests/src/tests/course-material/blocks/author.spec.ts(1 hunks)system-tests/src/tests/course-material/blocks/custom-iframe.spec.ts(1 hunks)system-tests/src/tests/course-material/blocks/latex.spec.ts(1 hunks)system-tests/src/tests/course-material/navigation/find-hidden-page.spec.ts(1 hunks)system-tests/src/tests/course-material/navigation/headings.spec.ts(1 hunks)system-tests/src/tests/course-material/rendering/content-components.spec.ts(1 hunks)system-tests/src/tests/course-material/visibility/preview-unopened.spec.ts(1 hunks)system-tests/src/tests/exams/exam-instructions.spec.ts(1 hunks)system-tests/src/tests/exams/exam-list.spec.ts(1 hunks)system-tests/src/tests/exams/exam-with-automatic-eligibility.spec.ts(1 hunks)system-tests/src/tests/exams/taking-exam.spec.ts(1 hunks)system-tests/src/tests/exercises/completions/automatic.spec.ts(1 hunks)system-tests/src/tests/exercises/grading/point-view.spec.ts(1 hunks)system-tests/src/tests/exercises/management/list.spec.ts(1 hunks)system-tests/src/tests/exercises/multiple-tasks/enable-resubmitting.spec.ts(1 hunks)system-tests/src/tests/exercises/multiple-tasks/multiple-task-exercise.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/automatically-grade-by-average.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/automatically-grade-or-manual-review-by-average.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/giving-extra-reviews.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/manual-review-everything.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/peer-review-editor.spec.ts(1 hunks)system-tests/src/tests/exercises/peer-reviews/peer-review-utils.ts(1 hunks)system-tests/src/tests/exercises/quizzes/create-and-save-quizzes.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/clickable-multiple-choice.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/essay.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/multiple-choice-dropdown.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/multiple-choice.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/open.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/scale.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/timeline.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/feedback/vector.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/checkbox-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/essay-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/matrix-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-clickable.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-long-text.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-column.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-row.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-dropdown.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-multi-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/multiple-choice-row-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/open-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/quizzes/widget/scale-widget.spec.ts(1 hunks)system-tests/src/tests/exercises/self-reviews/only-self-review.spec.ts(1 hunks)system-tests/src/tests/exercises/self-reviews/peer-and-self-review.spec.ts(1 hunks)system-tests/src/tests/exercises/settings/limited-tries.spec.ts(1 hunks)system-tests/src/tests/exercises/submissions/model-solution.spec.ts(1 hunks)system-tests/src/tests/pages/editor/sidebar-toggle.spec.ts(1 hunks)system-tests/src/tests/pages/editor/spacer-editing.spec.ts(1 hunks)system-tests/src/tests/pages/media/upload.spec.ts(1 hunks)system-tests/src/tests/pages/pages/history.spec.ts(1 hunks)system-tests/src/tests/pages/structure/manage.spec.ts(1 hunks)system-tests/src/tests/ui/listings/course-list.spec.ts(1 hunks)system-tests/src/tests/ui/listings/organization-list.spec.ts(1 hunks)system-tests/src/tests/ui/notifications/error-notification.spec.ts(1 hunks)system-tests/src/tests/ui/notifications/success-notification.spec.ts(1 hunks)system-tests/src/tests/user-management/search.spec.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`system-tests/**/*`: For Playwright system tests, make sure each test that triggers a backend mutation (e.g., clicking a save button) waits for a UI confirmation element that prove...
system-tests/**/*: For Playwright system tests, make sure each test that triggers a backend mutation (e.g., clicking a save button) waits for a UI confirmation element that proves the request completed successfully before proceeding. Otherwise, the test might continue before the operation finishes.
Also if someone navigates to a course page, and clicks continue on a dialog straight away, make sure its done with theselectCourseInstanceIfPromptedfunction.
system-tests/src/tests/pages/editor/sidebar-toggle.spec.tssystem-tests/src/tests/exercises/settings/limited-tries.spec.tssystem-tests/src/tests/user-management/search.spec.tssystem-tests/src/tests/exams/exam-list.spec.tssystem-tests/src/tests/pages/media/upload.spec.tssystem-tests/src/tests/exercises/completions/automatic.spec.tssystem-tests/src/tests/course-management/modules/manage.spec.tssystem-tests/src/tests/api/langs.spec.tssystem-tests/src/tests/admin/playground.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-row.spec.tssystem-tests/src/tests/exercises/self-reviews/only-self-review.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/vector.spec.tssystem-tests/src/tests/course-management/language/versions.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-clickable.spec.tssystem-tests/src/tests/course-material/rendering/content-components.spec.tssystem-tests/src/tests/course-material/visibility/preview-unopened.spec.tssystem-tests/src/tests/course-management/language/change-user-preference.spec.tssystem-tests/src/tests/course-material/blocks/custom-iframe.spec.tssystem-tests/src/tests/course-features/cheating-detection/manage.spec.tssystem-tests/src/tests/course-features/certificates/configure-certificate.spec.tssystem-tests/src/tests/exams/exam-with-automatic-eligibility.spec.tssystem-tests/src/tests/course-material/navigation/find-hidden-page.spec.tssystem-tests/src/tests/pages/structure/manage.spec.tssystem-tests/src/tests/exercises/peer-reviews/giving-extra-reviews.spec.tssystem-tests/src/tests/exams/exam-instructions.spec.tssystem-tests/src/tests/exercises/peer-reviews/peer-review-utils.tssystem-tests/src/tests/exercises/self-reviews/peer-and-self-review.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-dropdown.spec.tssystem-tests/src/tests/course-management/instances/course-instance-management.spec.tssystem-tests/src/tests/exercises/quizzes/widget/matrix-widget.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-widget.spec.tssystem-tests/src/tests/course-features/research-form/manage.spec.tssystem-tests/src/tests/admin/exercise-service.spec.tssystem-tests/src/tests/authentication/login.spec.tssystem-tests/src/tests/course-management/status/draft.spec.tssystem-tests/src/tests/course-features/feedback/proposed-edits.spec.tssystem-tests/src/tests/exercises/quizzes/widget/scale-widget.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-long-text.spec.tssystem-tests/src/tests/exercises/peer-reviews/manual-review-everything.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/timeline.spec.tssystem-tests/src/tests/exercises/multiple-tasks/multiple-task-exercise.spec.tssystem-tests/src/tests/exercises/peer-reviews/automatically-grade-by-average.spec.tssystem-tests/src/tests/course-material/blocks/author.spec.tssystem-tests/src/tests/exercises/management/list.spec.tssystem-tests/src/tests/course-material/blocks/audio.spec.tssystem-tests/src/tests/course-features/search/content-search.spec.tssystem-tests/src/tests/ui/listings/course-list.spec.tssystem-tests/src/tests/ui/listings/organization-list.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-row-widget.spec.tssystem-tests/src/tests/pages/editor/spacer-editing.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/open.spec.tssystem-tests/src/tests/exercises/multiple-tasks/enable-resubmitting.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-multi-widget.spec.tssystem-tests/src/tests/exercises/quizzes/widget/essay-widget.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/multiple-choice-dropdown.spec.tssystem-tests/src/tests/exercises/quizzes/widget/open-widget.spec.tssystem-tests/src/tests/course-features/glossary/manage.spec.tssystem-tests/src/tests/exercises/quizzes/create-and-save-quizzes.spec.tssystem-tests/src/tests/authentication/research-consent.spec.tssystem-tests/src/tests/course-material/navigation/headings.spec.tssystem-tests/src/tests/course-management/creation/create-course-with-exercise.spec.tssystem-tests/src/tests/course-management/progress/reset.spec.tssystem-tests/src/tests/pages/pages/history.spec.tssystem-tests/src/tests/exercises/quizzes/widget/checkbox-widget.spec.tssystem-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-column.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/clickable-multiple-choice.spec.tssystem-tests/src/tests/exercises/grading/point-view.spec.tssystem-tests/src/tests/course-features/certificates/generate-certificate.spec.tssystem-tests/src/tests/exercises/peer-reviews/automatically-grade-or-manual-review-by-average.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/scale.spec.tssystem-tests/src/tests/course-management/permissions/manage.spec.tssystem-tests/src/tests/exercises/submissions/model-solution.spec.tssystem-tests/src/tests/ui/notifications/error-notification.spec.tssystem-tests/src/tests/exams/taking-exam.spec.tssystem-tests/src/tests/ui/notifications/success-notification.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/multiple-choice.spec.tssystem-tests/src/tests/course-features/feedback/give-and-manage.spec.tssystem-tests/src/tests/exercises/quizzes/feedback/essay.spec.tssystem-tests/src/tests/exercises/peer-reviews/peer-review-editor.spec.tssystem-tests/src/tests/course-management/instances/add-completions.spec.tssystem-tests/src/tests/course-material/blocks/latex.spec.tssystem-tests/src/tests/course-features/glossary/tooltip.spec.tssystem-tests/src/tests/course-features/references/manage.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: build-and-deploy
- GitHub Check: headless_lms
🔇 Additional comments (160)
system-tests/src/tests/pages/media/upload.spec.ts (1)
9-9: Standardized Absolute Import for Screenshot Utility
The updated import using the alias@/utils/screenshotimproves consistency and maintainability across the system tests. No functionality changes were introduced.system-tests/src/tests/pages/editor/sidebar-toggle.spec.ts (1)
3-3: Updated Import Path for Screenshot Utility
Changing the import to use@/utils/screenshotstandardizes the module references across our tests. This aligns with our new absolute path policy without impacting functionality.system-tests/src/tests/exercises/management/list.spec.ts (1)
3-3: Standardized Absolute Import for Screenshot Utility
The updated import using the absolute alias@/utils/screenshotis consistent with our broader refactoring effort.system-tests/src/tests/user-management/search.spec.ts (1)
3-3: Standardized Absolute Import for Screenshot Utility
The import update to@/utils/screenshotenhances clarity by using absolute paths. The test logic remains unaffected and continues to validate the search functionality appropriately.system-tests/src/tests/authentication/login.spec.ts (1)
9-9: Standardized Absolute Import for Logout Utility
The update of the logout function’s import to use the absolute path@/utils/logoutis a positive improvement for consistency across the codebase. The login and logout flows also correctly wait for UI confirmations (e.g. waiting for "Log in" text and URL changes), which aligns with our testing guidelines.system-tests/src/tests/course-management/modules/manage.spec.ts (1)
3-3: Standardized Import Path for Screenshot Utility
The import forexpectScreenshotsToMatchSnapshotsnow uses the absolute alias (@/utils/screenshot), which is consistent with our new conventions.system-tests/src/tests/course-features/certificates/configure-certificate.spec.ts (1)
3-3: Standardized Import Path for Screenshot Utility
The import forexpectScreenshotsToMatchSnapshotshas been updated to the absolute path (@/utils/screenshot), enhancing clarity and maintainability across tests.system-tests/src/tests/exams/exam-list.spec.ts (2)
3-3: Standardized Import Path for Expect Utility
The updated import path forexpectUrlPathWithRandomUuid(using the@/utils/expectalias) ensures consistent module referencing across the test suite.
28-31: Backend Mutation Confirmation via UI Element
After the exam creation is triggered (line 28), the test waits for a “Success” message (line 29) before proceeding. This explicit confirmation helps ensure that the backend mutation has completed successfully.system-tests/src/tests/admin/playground.spec.ts (2)
3-3: Standardized Import Path for IFrame Utility
The import forscrollLocatorsParentIframeToViewIfNeededhas been updated to use an absolute path (@/utils/iframeLocators), aligning with our project’s import standardization.
9-14: Effective Use of IFrame Scrolling Utility
The call toscrollLocatorsParentIframeToViewIfNeeded(line 9) ensures that elements within the iframe are scrolled into view before interaction, which improves the stability of the test.system-tests/src/tests/exercises/settings/limited-tries.spec.ts (2)
3-3: Standardized Import Path for Course Material Actions Utility
The import forselectCourseInstanceIfPromptednow uses the absolute alias (@/utils/courseMaterialActions), which enhances consistency across our test modules.
52-54: Proper Handling of Course Instance Selection
The use ofselectCourseInstanceIfPrompted(line 53) correctly addresses the potential issue of an immediate dialog after navigation. This usage aligns well with our guideline to wait for UI confirmations before proceeding with course navigation.system-tests/src/tests/course-management/language/change-user-preference.spec.ts (1)
3-4: Standardized Import PathsThe import paths for both
selectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotshave been updated to use the absolute alias (@). This change improves clarity and maintainability, aligning this test with the broader repository standards.system-tests/src/tests/pages/structure/manage.spec.ts (1)
4-4: Standardized Screenshot Utility ImportThe import for
expectScreenshotsToMatchSnapshotsnow uses an absolute path (@/utils/screenshot) rather than a relative one. This update enhances consistency and simplifies module resolution across the test suite.system-tests/src/tests/exercises/self-reviews/only-self-review.spec.ts (1)
3-3: Standardized Course Instance Utility ImportThe import for
selectCourseInstanceIfPromptedhas been changed to use the absolute path (@/utils/courseMaterialActions). This modification aligns the file with the project-wide strategy for absolute imports and improves overall readability.system-tests/src/tests/exercises/peer-reviews/automatically-grade-by-average.spec.ts (1)
3-3: Refactored Peer Review Utilities ImportThe module name in the import statement has been updated from
"./peer_review_utils"to"./peer-review-utils", reflecting a renaming that improves consistency with the project's file naming conventions.system-tests/src/tests/exercises/quizzes/widget/scale-widget.spec.ts (1)
3-4: Standardized Quiz Widget Utility ImportsBoth the
getLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotsfunctions are now imported using absolute paths (@/utils/iframeLocatorsand@/utils/screenshot, respectively). This change enhances clarity and consistency within the quiz widget tests.system-tests/src/tests/ui/listings/organization-list.spec.ts (2)
3-3: Standardized Import Path
The import forexpectScreenshotsToMatchSnapshotsis now using an absolute path ("@/utils/screenshot") instead of a relative one. This change enhances consistency and maintainability across the codebase.
9-19: UI Confirmation for Screenshot Comparison
The test "Organization list renders" correctly waits for UI elements (usingwaitForTheseToBeVisibleAndStable) ensuring that the screenshots are taken only after key elements (e.g. the text "learn the basics in Computer Science") are visible and stable. This adheres nicely to our guidelines for backend mutations and UI confirmations.system-tests/src/tests/course-management/progress/reset.spec.ts (2)
3-3: Updated Import for Course Material Actions
The change to use an absolute path ("@/utils/courseMaterialActions") for importingselectCourseInstanceIfPromptedis spot on. This aligns with our project-wide move towards standardized import paths.
9-15: Effective UI Confirmation in Test Steps
Both tests in this file ("Resetting teacher's own progress resets points" and the one for all students) wait for explicit UI confirmation elements (e.g. "Successfully deleted") after triggering backend mutations. This ensures that state changes are reliably reflected in the UI before further actions are taken.system-tests/src/tests/course-management/language/versions.spec.ts (3)
3-4: Consistent Import Path Standardization
The imports for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsare now using absolute paths with the@alias. This change improves clarity and consistency across our test suites.
10-18: Robust Test Flow for Language Version Creation
The test "Creating a new language version works" integrates proper UI confirmation (waiting for "Course created successfully") and correctly usesselectCourseInstanceIfPromptedto handle any intermediate prompts. This ensures that backend mutations (like creating a language version) are properly validated through visible UI feedback.
84-87: Permissions Verification
The subsequent tests also appropriately check for the presence of key text elements (e.g., the teacher's email) to verify that permission changes have been successfully applied.system-tests/src/tests/course-management/instances/course-instance-management.spec.ts (2)
3-4: Absolute Imports for Utility Functions
The import updates fordownloadToStringand the notification utilities are correct. Switching from relative paths to absolute paths ("@/utils/download"and"@/utils/notificationUtils") aids in reducing path resolution errors and enhances code readability.
25-40: Comprehensive UI Confirmation in Instance Management
The test "Managing course instances works" makes effective use of UI confirmations:
- It waits for CSV downloads via
page.waitForEvent("download")and validates the content.- It confirms success messages (like "Success") after triggering instance updates.
These practices ensure that backend mutations (such as exporting submissions and editing instance details) are fully completed before the test progresses.system-tests/src/tests/exercises/completions/automatic.spec.ts (4)
3-4: Standardized Import Paths for Completion Test
The update of the import paths forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsto use the@alias is consistent with our standardized approach across system tests.
10-18: Proper Use of Intermediate UI Confirmations
Within the "Registers automatic completion" test, the use ofselectCourseInstanceIfPromptedcombined with waits for URL changes and text confirmations (e.g., "Good job!" and "Congratulations!") ensures that backend operations are complete before advancing through the flow. This adherence to waiting for UI confirmations greatly enhances test reliability.
28-33: Effective Frame and Navigation Handling
The test correctly interacts with an iframe and waits for confirmation of the submission action by verifying that "Good job!" appears after clicking the submit button. This confirms that even interactions within embedded contexts are handled reliably.
37-49: Thorough Visual Regression Check
The use ofexpectScreenshotsToMatchSnapshotswith clearly defined parameters (includingwaitForTheseToBeVisibleAndStableand abeforeScreenshotscroll adjustment) is excellent. It ensures that the snapshot comparisons occur in a consistent UI state, reducing flaky test outcomes.system-tests/src/tests/api/langs.spec.ts (2)
3-3: Standardized Import Path for Utility Function
Updating the import to use the alias (@/utils/courseMaterialActions) improves consistency and readability across the test suite.
28-35: Proper Usage of Course Instance Handling
The test navigates to the course page and then callsselectCourseInstanceIfPrompted(page)to handle any potential prompt. Verify that the implementation of the utility function properly waits for UI confirmation before proceeding.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-clickable.spec.ts (2)
3-4: Absolute Imports for Iframe and Screenshot Utilities
The changes to importgetLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotsfrom absolute paths (@/utils/...) promote uniformity and ease of refactoring.
10-11: UI Stability and Screenshot Verification
The test correctly navigates to the playground, selects the proper quiz example, and uses the provided utility functions to capture stable screenshots before and after user interactions. This ensures consistent visual regression testing.system-tests/src/tests/exercises/quizzes/feedback/timeline.spec.ts (3)
3-4: Consistent Absolute Import Updates
Updating the imports for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsto absolute paths helps maintain a uniform import strategy across tests.
15-29: Backend Mutation and UI Confirmation Handling
The timeline feedback test navigates to the course timeline, applies the course instance selection, and then waits for confirmation messages (e.g., "Your answer was partially correct." and "Your answer was correct."). This provides good synchronization with backend mutations.
77-88: Waiting for Element Stability Post-Mutation
Before taking subsequent screenshots, the test waits for key UI elements (e.g., disabled buttons and confirmation texts) which indicates that UI updates are stable after actions.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-dropdown.spec.ts (2)
3-4: Standardized Import Paths for Consistency
The update to importgetLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotsusing the absolute alias ensures uniformity across the test files and reduces potential path errors.
10-16: Effective UI Interaction and Visual Validation
The test sets up the dropdown scenario correctly by selecting the appropriate options and then capturing screenshots both before and after the interaction. This aligns with the need for UI confirmation when backend actions could be involved.system-tests/src/tests/exercises/quizzes/feedback/vector.spec.ts (2)
3-4: Uniform Import Path Updates
Changing the import paths forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsto use the@/alias standardizes the code and simplifies module resolution in the tests.
15-29: Robust UI Confirmation for Backend Mutation
The vector feedback test properly handles UI synchronization by:
- Invoking
selectCourseInstanceIfPrompted(page)immediately after navigation.- Waiting for feedback messages (e.g., "Your answer was not correct." and "Your answer was correct.") after each submission.
This approach ensures that backend mutations have been acknowledged by the UI before the test proceeds.system-tests/src/tests/admin/exercise-service.spec.ts (1)
3-4: Standardized Import Paths for Utility Modules
The import statements have been updated to use the absolute alias (@) for bothexpectUrlPathWithRandomUuidandexpectScreenshotsToMatchSnapshots. This change improves readability and consistency across the test suite. Additionally, the test flow—for example, waiting for the "New exercise service" element after creating a service—ensures that UI confirmations are properly handled.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-row.spec.ts (1)
3-5: Updated Import Statements to Absolute Paths
The modification updates the import paths forselectCourseInstanceIfPrompted,getLocatorForNthExerciseServiceIframe, andexpectScreenshotsToMatchSnapshotsto the standardized@alias. This enhances maintainability and ensures consistency in module resolution across tests.system-tests/src/tests/course-material/blocks/author.spec.ts (1)
3-4: Refactored Imports to Use Absolute Paths
Switching the imports forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsfrom a relative path to the absolute@alias significantly improves clarity and reduces potential path resolution issues. The test also properly invokesselectCourseInstanceIfPromptedto ensure any course-instance prompts are handled.system-tests/src/tests/course-material/blocks/custom-iframe.spec.ts (1)
3-4: Consistent Absolute Import Paths for Utility Functions
The changes update the import statements for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsto reflect the new absolute path convention. This not only standardizes our codebase but also simplifies future refactors. Moreover, the test correctly waits for UI confirmations—such as the "Operation successful!" message—after triggering a backend mutation.system-tests/src/tests/course-material/blocks/audio.spec.ts (1)
3-3: Standardized Import for Course Instance Prompt
The update changes the import forselectCourseInstanceIfPromptedto use the@alias rather than a relative path. This aligns with our new module import strategy, enhancing both consistency and clarity. The test itself properly waits for key UI elements (e.g., after uploading an audio file) before proceeding.system-tests/src/tests/course-material/rendering/content-components.spec.ts (1)
3-4: Standardized Import Paths Updated Correctly
The update to absolute import paths for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsaligns with our new guidelines and improves clarity.system-tests/src/tests/course-features/cheating-detection/manage.spec.ts (1)
3-3: Import Path Standardization for answerExercise
The import update foranswerExercisefrom a relative to an absolute path enhances consistency across the tests.system-tests/src/tests/exercises/peer-reviews/peer-review-utils.ts (1)
5-5: Absolute Import Path for selectCourseInstanceIfPrompted
The change to use an absolute import forselectCourseInstanceIfPromptedis consistent with the new standardized import structure.system-tests/src/tests/course-material/visibility/preview-unopened.spec.ts (1)
3-3: Import Path Standardization for selectCourseInstanceIfPrompted
Updating the import to an absolute path improves clarity and maintainability across our tests.system-tests/src/tests/exercises/self-reviews/peer-and-self-review.spec.ts (2)
3-3: Absolute Import Path for selectCourseInstanceIfPrompted
The update to an absolute import here is in line with changes across the codebase and enhances maintainability.
30-66: Teacher Configuration Workflow Validated
The teacher’s configuration steps—for example, clicking "Save" and waiting for "Operation successful!"—are correctly synchronized to confirm that backend mutations have completed before proceeding.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-row-widget.spec.ts (2)
3-4: Standardized Absolute Import Paths
The import statements for bothgetLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotshave been updated to use the@alias. This improves consistency across the test files and simplifies module resolution.
17-25: UI Confirmation via Screenshot Checks
The test usesexpectScreenshotsToMatchSnapshotswith well-defined wait conditions (e.g., ensuring that specific text elements are visible and stable) immediately after user interactions. This confirms that any backend mutations are complete before proceeding, adhering to our system test guidelines.system-tests/src/tests/exercises/multiple-tasks/multiple-task-exercise.spec.ts (2)
3-3: Absolute Import for Course Actions
The updated import forselectCourseInstanceIfPromptednow uses the absolute alias ("@/utils/courseMaterialActions"), which promotes a consistent and maintainable import strategy across the system tests.
13-13: Consistent Handling of Course Page Dialogs
The call toselectCourseInstanceIfPrompted(page)ensures that if a dialog is presented when navigating to a course page, it is handled appropriately. This aligns with the guideline that any prompt continuation is managed via this helper function.system-tests/src/tests/exams/taking-exam.spec.ts (2)
3-3: Updated Screenshot Utility Import
The change to importexpectScreenshotsToMatchSnapshotsfrom"@/utils/screenshot"ensures a standardized import style across the tests, which aids readability and maintainability.
8-10: Ensuring Backend Mutation Completion via UI Checks
After initiating the exam—especially after clicking the "Start the exam!" button—the test immediately verifies UI state using screenshot comparisons. These validations help confirm that backend operations have completed before additional actions are attempted.system-tests/src/tests/exercises/quizzes/widget/matrix-widget.spec.ts (2)
4-7: Consistent Import Path Refactoring
The import statements forgetLocatorForNthExerciseServiceIframe,scrollLocatorsParentIframeToViewIfNeeded, andexpectScreenshotsToMatchSnapshotshave been refactored to use the absolute alias. This update enhances consistency across our test suites.
23-29: Robust UI Validation for Matrix Interactions
The test employsexpectScreenshotsToMatchSnapshotsto verify that cell fills and other interactions in the matrix widget produce the expected visual state. This approach ensures that any backend updates are fully rendered and stable before the test proceeds.system-tests/src/tests/exams/exam-with-automatic-eligibility.spec.ts (3)
3-4: Standardized Imports for Eligibility Testing
The imports for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotshave been updated to use the@alias, which matches our broader refactoring effort across system tests.
29-30: Proper Handling of Course Prompt Dialogs
The insertion ofselectCourseInstanceIfPrompted(page)right after navigating to the course page ensures that any prompt dialogs are managed uniformly. This complies with our guideline for handling course instance continuations.
43-54: Thorough UI Confirmation on Exam Eligibility
By leveraging screenshot comparisons both before and after course interactions, the test robustly verifies that the state transitions (in exam eligibility) occur as expected. Waiting for specific UI elements provides strong evidence that any backend mutations have been fully processed.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-multi-widget.spec.ts (2)
1-8: Absolute Import Paths Updated
The conversion from relative paths (e.g.../../../utils/iframeLocatorsand../../../utils/screenshot) to absolute paths using the@alias improves clarity and maintainability. The change is clean and consistent with our new standards.
9-36: Test Navigation and Screenshot Stability
The test correctly navigates to the playground, selects the relevant quiz option, and interacts with the iframe. It then callsexpectScreenshotsToMatchSnapshotswith a properwaitForTheseToBeVisibleAndStablecondition ensuring that the key locator (the quiz question text) is stable before taking the snapshot. No backend mutation is triggered here, so the current waiting strategy appears appropriate.system-tests/src/tests/exercises/submissions/model-solution.spec.ts (3)
3-7: Standardized Import Paths
The updated imports for utilities—such asselectCourseInstanceIfPrompted,expectUrlPathWithRandomUuid,getLocatorForNthExerciseServiceIframe, andexpectScreenshotsToMatchSnapshots—using the absolute path@/utils/...are correctly applied. This change will help reduce path errors and improve code clarity across the suite.
12-59: Robust Navigation and Verification in Submissions Test
The first test case systematically navigates through the organization page, validates URL paths usingexpectUrlPathWithRandomUuid, and waits for the appearance of the "Submission time" text. The subsequent screenshot capture is conditioned on the frame locator being stable, which is good practice.
61-93: Appropriate Handling of Dialog Prompts and UI Assertions
In the second test, the usage ofselectCourseInstanceIfPromptedensures that any course-instance landing dialogs are handled as per our guidelines. The test continues to verify URL transitions and performs screenshot verification, which together provide a strong assertion of the expected UI state.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-long-text.spec.ts (1)
3-7: Consistent Import Path Refactor
The refactoring to importgetLocatorForNthExerciseServiceIframe,scrollLocatorsParentIframeToViewIfNeeded, andexpectScreenshotsToMatchSnapshotsvia the absolute@/utils/...paths improves consistency and future maintainability of our tests.system-tests/src/tests/exams/exam-instructions.spec.ts (1)
1-3: Updated Screenshot Utility Import
The import forexpectScreenshotsToMatchSnapshotsnow uses the absolute path (@/utils/screenshot), ensuring consistency with our new import standards.system-tests/src/tests/course-features/certificates/generate-certificate.spec.ts (3)
3-4: Standardized Imports for Certificate Generation
The import paths forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotshave been correctly updated to use the absolute alias. This change streamlines module resolution and aligns with our broader refactoring goals.
10-29: Comprehensive Certificate Generation Workflow
The test effectively navigates through the certificate generation process by interacting with links, buttons, and form fields. The use ofselectCourseInstanceIfPromptedensures that any course page dialog prompt is handled correctly. Additionally, the dialog acceptance logic for the certificate generation is implemented in a straightforward manner.
38-47: Screenshot Verification for Generated Certificate
The final verification step usesexpectScreenshotsToMatchSnapshotsto capture the certificate image. By waiting for the certificate image to become visible and stable, the test robustly asserts that the certificate generation has succeeded and that the visual output matches expectations.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-column-widget.spec.ts (2)
3-4: Standardize Import Paths Using the@Alias
The import statements forgetLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotshave been correctly updated from relative paths to use the absolute@alias. This improves consistency and maintainability across the test suite.
10-50: Ensure UI Stability in Screenshot Tests
Each screenshot test call correctly utilizes thewaitForTheseToBeVisibleAndStableparameter to wait for key UI elements before capturing snapshots. This guarantees that the tests do not proceed until the UI is stable.system-tests/src/tests/course-features/references/manage.spec.ts (2)
3-4: Update Import Paths for Consistency
The modifications updating the import paths forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsto use the@alias are correctly applied. This change standardizes module resolution across the system tests.
10-40: Verify UI Confirmation After Mutative Actions
The test workflow—especially after submitting new reference data—includes appropriate waits (e.g., waiting for "Success" and ensuring "Error" remains hidden) before taking screenshots. This adheres to our guideline to wait for backend mutations to complete via visible UI confirmations.system-tests/src/tests/course-management/status/draft.spec.ts (3)
3-4: Standardize Absolute Import Paths
The import statements for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotshave been successfully refactored to use the@alias, ensuring consistency with the new project conventions.
54-101: Confirm UI Confirmation After Course Mutations
Within the admin test that creates and then updates a draft course, the usage ofexpectScreenshotsToMatchSnapshotswith thewaitForTheseToBeVisibleAndStableoption confirms that UI feedback (e.g., course status changes) is properly awaited before proceeding. This complies with the guideline for backend mutation tests.
104-137: Handle Course Instance Prompts in Teacher Tests
The teacher test sections effectively use theselectCourseInstanceIfPromptedfunction to correctly manage any prompted dialogs when navigating to course pages. This ensures that the test flow waits for any necessary UI confirmation before continuing.system-tests/src/tests/course-material/navigation/find-hidden-page.spec.ts (2)
3-4: Refactor Import Paths to Use the@Alias
The updated import statements forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsnow use the absolute path alias@, which improves clarity and maintainability throughout the tests.
10-55: Validate Workflow for Navigating Hidden Pages
The test for locating hidden pages correctly navigates through the application and waits for a specific confirmation element ("You found the secret of the project 331!") to be visible before capturing the screenshot. This ensures stability in detecting UI state changes.system-tests/src/tests/ui/listings/course-list.spec.ts (2)
3-4: Enforce Absolute Imports for Utility Functions
The import paths forexpectUrlPathWithRandomUuidandexpectScreenshotsToMatchSnapshotshave been updated to the@alias format. This aligns with the overall project efforts toward standardized and maintainable code.
10-27: Verify Course Listing Test Functionality
The test correctly navigates to the organizations page, interacts with the course listing, validates the URL path with a random UUID, and uses stable screenshot assertions. These steps help ensure that the course list UI is rendered as expected.system-tests/src/tests/pages/pages/history.spec.ts (2)
4-11: Standardized Import Paths
The import statements have been updated to use absolute paths (e.g.,@/utils/cmsUtils,@/utils/courseMaterialActions, etc.), which enhances clarity and maintainability.
27-27: Consistent Use of Instance Handling
The call toselectCourseInstanceIfPrompted(page)ensures that any course-related dialog is handled uniformly. This aligns well with our guidelines.system-tests/src/tests/course-features/research-form/manage.spec.ts (3)
3-4: Absolute Import Path Consistency
The updates to importselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsusing the@alias are correctly applied, ensuring consistency across our test files.
38-40: Backend Mutation Confirmation Check
After clicking the Save button, the test waits for the "Operation successful!" message. This explicit wait confirms that the backend mutation has completed successfully.
62-81: UI Confirmation for User Setting Update
The “User can change answer of the research form” test waits for the "User settings" element after saving the answer. This provides a clear UI confirmation that the update has been processed.system-tests/src/tests/exercises/quizzes/create-and-save-quizzes.spec.ts (1)
3-7: Standardized Imports for Quiz Utilities
The import statements forexpectUrlPathWithRandomUuidand functions from@/utils/iframeLocatorshave been updated to absolute paths. This change ensures consistency with our repository-wide alias strategy.system-tests/src/tests/exercises/multiple-tasks/enable-resubmitting.spec.ts (3)
3-4: Updated Absolute Import Paths
The change to importselectCourseInstanceIfPromptedandscrollLocatorsParentIframeToViewIfNeededusing the@alias is correctly implemented, improving code clarity.
50-52: Backend Mutation Confirmation on Submit
After clicking the Submit button (line 50), the test waits for the "Try again" text (line 51). This wait helps confirm that the submission mutation has been processed by the backend.
72-83: Resubmission Flow Validation
The flow for modifying an incorrect answer and resubmitting is well handled, with appropriate waits ensuring that updated UI elements (e.g., the second "Correct" button) are attached before interacting.system-tests/src/tests/course-material/blocks/latex.spec.ts (2)
4-6: Absolute Import Updates for Latex Test
The import statements forselectCourseInstanceIfPrompted,expectUrlPathWithRandomUuid, andexpectScreenshotsToMatchSnapshotsnow use absolute paths. This update aligns with our standardized module resolution strategy.
12-136: LaTeX Block Rendering and UI Confirmation
The test comprehensively simulates course creation, page editing, and the insertion of a LaTeX block. The final use ofexpectScreenshotsToMatchSnapshotsvalidates that key texts (e.g., "Inline latex" and "Wubba Lubba Dub Dub") render correctly. This provides a robust UI confirmation of the underlying backend operations.system-tests/src/tests/course-features/search/content-search.spec.ts (2)
3-5: Standardized Import Paths for Utility Functions
The import statements forselectCourseInstanceIfPrompted,expectUrlPathWithRandomUuid, andexpectScreenshotsToMatchSnapshotshave been correctly updated to use the absolute alias (@/). This improves clarity and consistency across the test suite.
7-22: Proper Use of UI Confirmation for Course Navigation
The test properly triggers navigation and usesselectCourseInstanceIfPrompted(page)(line 21) to handle potential course instance dialogs. Additionally, the subsequent UI validations (like waiting for specific texts and URL changes) ensure the test only proceeds once the required UI state is observed.system-tests/src/tests/exercises/quizzes/feedback/essay.spec.ts (2)
1-5: Updated Import Paths with Aliased References
The modifications on lines 3-5 correctly update the import paths to use the absolute alias (e.g.,@/utils/courseMaterialActionsand@/utils/iframeLocators), ensuring consistency across modules and simplifying maintenance.
15-23: Ensuring UI Readiness for Feedback Tasks
After navigating to the course page and triggering feedback actions, the test usesselectCourseInstanceIfPrompted(page)(line 25) and waits for confirmation elements (e.g., waiting for the frame text "write an essay"). The conditional block handling retries also reinforces that the UI has stabilized before proceeding. This careful wait structure helps mitigate flakiness associated with backend mutations.system-tests/src/tests/course-features/glossary/manage.spec.ts (2)
1-5: Consistent Import Alias Usage for Glossary Utilities
The updated imports on lines 3-5 now use absolute paths (e.g.,@/utils/courseMaterialActions,@/utils/screenshot, and@/utils/waitingUtils). This standardization enhances maintainability and avoids potential path resolution issues in a large test suite.
11-31: Robust UI Confirmation in Glossary Management Flow
The test implements a solid flow by waiting for clear UI states – for instance, ensuring the correct snapshot of the initial glossary page (line 29) before proceeding, and properly handling course navigation withselectCourseInstanceIfPrompted(page)(line 21). This adherence to waiting for UI confirmation is in line with our guidelines for backend mutation confirmations.system-tests/src/tests/course-features/feedback/proposed-edits.spec.ts (2)
1-5: Aliased Import Paths for Proposed Edits Utilities
The changes on lines 3-5 update the import paths to the absolute alias (@/) – this coversselectCourseInstanceIfPrompted,getLocatorForNthExerciseServiceIframe, andexpectScreenshotsToMatchSnapshots. This is consistent with the overall move toward standardized import paths across the tests.
11-20: Effective Use of UI Confirmation for Feedback Submission
In the "Making proposed edits works" test, the sequence begins with navigating to the course page and effectively usingselectCourseInstanceIfPrompted(page)(line 23). Later in the workflow, after clicking "Send" (line 100), the test waits for confirmation elements like the "Feedback submitted successfully" message (line 102) and specific snapshot conditions. These waits help ensure that backend mutations have been fully applied before proceeding.system-tests/src/tests/course-management/permissions/manage.spec.ts (2)
1-4: Standardized Notification Utility Imports
The updated import on lines 3-4 correctly brings inhideToasts,showNextToastsInfinitely,showToastsNormally, andexpectScreenshotsToMatchSnapshotsusing the absolute path (@/utils/notificationUtilsand@/utils/screenshot). This change promotes a cleaner and more consistent dependency management approach within the test files.
10-21: Comprehensive UI Confirmation Before and After Backend Mutations
The permissions management test demonstrates clear and explicit waits for UI confirmations – for example, after triggering role additions or edits, the test waits for "Success" messages (lines 12, 31, 92, and 105). The screenshot snapshot verifications further confirm that the UI has reached the expected state before moving on. This adherence greatly minimizes the risk of race conditions associated with asynchronous mutations.system-tests/src/tests/exercises/quizzes/feedback/scale.spec.ts (1)
3-4: Standardize Import Paths
The changes to update the import statements to absolute paths using the@alias for bothselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshotsare clear and consistent. This aligns with our overall effort to improve clarity and maintainability across the test suite.system-tests/src/tests/ui/notifications/error-notification.spec.ts (1)
3-4: Standardize Import Statements for Notifications Tests
The updated import paths forshowNextToastsInfinitely,showToastsNormally, andexpectScreenshotsToMatchSnapshotsusing absolute imports (@/utils/...) enhance readability and consistency.system-tests/src/tests/exercises/quizzes/feedback/multiple-choice-dropdown.spec.ts (1)
3-5: Consistent Aliased Imports for Quiz Feedback
The modifications converting the import paths forselectCourseInstanceIfPrompted,getLocatorForNthExerciseServiceIframe, andexpectScreenshotsToMatchSnapshotsto use the@alias are well implemented. These changes simplify module references and ensure consistency across the test files.system-tests/src/tests/authentication/research-consent.spec.ts (1)
3-4: Standardize Imports in Research Consent Tests
The transition to absolute import paths forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshots(using@/utils/...) is correctly applied. This update keeps the codebase uniform and enhances future maintainability.system-tests/src/tests/course-features/glossary/tooltip.spec.ts (1)
3-4: Updated Import Paths for Glossary Tooltip Test
The change to use absolute paths in the import statements forselectCourseInstanceIfPromptedandexpectScreenshotsToMatchSnapshots(switching to the@alias) is consistent with related test files. This standardization improves both clarity and maintainability.system-tests/src/tests/course-material/navigation/headings.spec.ts (1)
3-4: Standardize Import Paths
The updated import statements now use the absolute paths with the@alias instead of relative paths. This change makes module resolution clearer and increases maintainability across our test suite.system-tests/src/tests/pages/editor/spacer-editing.spec.ts (1)
3-4: Update Import Paths
The imports forexpectScreenshotsToMatchSnapshotsandwaitForFooterTranslationsToLoadhave been updated to the absolute paths using the@alias. This helps standardize our codebase and reduces the risk of path resolution issues as the project scales.system-tests/src/tests/exercises/quizzes/widget/essay-widget.spec.ts (1)
6-7: Update Import Paths in Essay Widget Test
The code now imports both the iframe locators and screenshot utility using the@alias rather than relative paths. This change is consistent with our efforts to standardize import paths and should help in future refactoring.system-tests/src/tests/exercises/quizzes/widget/open-widget.spec.ts (1)
3-4: Standardize Import Paths in Open Widget Test
The import updates forgetLocatorForNthExerciseServiceIframeandexpectScreenshotsToMatchSnapshotsnow use absolute paths with the@alias. This approach improves readability and ensures consistency across our system test files.system-tests/src/tests/exercises/quizzes/widget/checkbox-widget.spec.ts (1)
3-4: Consistent Import Path Updates in Checkbox Widget Test
The changes update the import paths for both the iframe locator and screenshot utility to use absolute paths via the@alias. This not only aligns with our coding guidelines but also improves maintainability throughout the test suite.system-tests/src/tests/course-management/creation/create-course-with-exercise.spec.ts (3)
3-3: Standardized Import for Course Material Actions
The updated import forselectCourseInstanceIfPromptednow uses the absolute alias"@/utils/courseMaterialActions", which aligns with our project-wide standardization effort. This change improves clarity and maintainability without affecting functionality.
4-4: Standardized Import for Expect Utility
The import forexpectUrlPathWithRandomUuidhas been updated to use the absolute alias"@/utils/expect", ensuring consistency across the test suite.
8-8: Standardized Import for iFrame Locators
The import of functions from"@/utils/iframeLocators"now uses an absolute path. This update enhances code clarity and reduces complexity in module resolution.system-tests/src/tests/ui/notifications/success-notification.spec.ts (1)
3-4: Standardized Imports for Notification and Screenshot Utilities
The updated import statements forshowNextToastsInfinitely,showToastsNormally, andexpectScreenshotsToMatchSnapshotsnow use absolute paths with the"@/"alias. This change is consistent with our codebase refactoring objectives and does not affect test functionality.system-tests/src/tests/exercises/peer-reviews/peer-review-editor.spec.ts (1)
3-4: Standardized Imports for Peer Review Editor Utilities
The imports forshowNextToastsInfinitely,showToastsNormally, andexpectScreenshotsToMatchSnapshotshave been updated to use absolute paths. This aligns with our overall refactoring effort and improves consistency across test files.system-tests/src/tests/course-management/instances/add-completions.spec.ts (1)
3-5: Standardized Imports for Completion Management Utilities
The imports fordownloadToString,showNextToastsInfinitely,showToastsNormally, andexpectScreenshotsToMatchSnapshotshave been updated from relative paths to use the absolute"@/"alias. This change streamlines the module resolution and is in line with the project’s import standardization goals.system-tests/src/tests/exercises/quizzes/feedback/open.spec.ts (1)
3-5: Standardized Imports for Quiz Feedback Utilities
The import statements forselectCourseInstanceIfPrompted,getLocatorForNthExerciseServiceIframe, andexpectScreenshotsToMatchSnapshotshave been refactored to use absolute paths with the"@/"alias. This update improves readability and maintainability, while keeping functionality intact.system-tests/src/tests/exercises/quizzes/feedback/clickable-multiple-choice.spec.ts (5)
3-5: Consistent Import Alias Update.
The updated import statements correctly use the absolute alias (@) instead of relative paths, which improves clarity and maintainability.
26-26: Proper Use of Course-Instance Prompt Handler.
The invocation ofselectCourseInstanceIfPrompted(page)ensures that any course-selection prompt is properly handled before continuing with test navigation.
38-47: Robust Retry Handling with UI Confirmation.
The test waits for the exercise frame (viaawait frame.getByText("Pick all the programming languages from below").waitFor()) and, in the retry block, ensures the “Try again” element is clicked and then hidden before revalidating the UI. This practice helps ensure that any backend mutation triggered by user actions is complete before further interactions.
57-65: UI Stability Verification via Snapshots.
UsingexpectScreenshotsToMatchSnapshotswith explicit wait conditions ensures that the UI elements are not just present but stable before capturing snapshots. This aligns well with our testing guidelines for verifying backend mutations through visible confirmations.
67-73: Retry Flow Verification Post-Interaction.
The test correctly resets the state by clicking “Try again” and then revalidates the UI (by waiting for the exercise text and rechecking the option states) before proceeding.system-tests/src/tests/exercises/quizzes/feedback/multiple-choice.spec.ts (7)
3-5: Consistent Update to Absolute Import Paths.
The import changes to use the@alias ensure that utility modules are referenced uniformly across the project, enhancing readability and future refactoring efforts.
26-26: Correct Handling of Course Selection Prompts.
InvokingselectCourseInstanceIfPrompted(page)immediately after navigation helps to manage any potential prompt dialogs, adhering to the best practices outlined in our guidelines.
19-22: Navigation and URL Verification.
The navigation steps, accompanied by URL assertions after clicking on key elements, confirm that the test proceeds only after the expected page transitions, ensuring stability in test execution.
40-50: Robust Conditional Retry Implementation.
The conditional block checkingif (testInfo.retry && (await page.getByText("Try again").isVisible()))enhances the resilience of the test by ensuring that retry logic is only executed when the “Try again” button is visible. This guards against false positives in subsequent test steps.
52-64: Snapshot-Based Confirmation After Submission.
After clicking answer options and submitting, the test waits for UI elements (via snapshots) that validate the backend mutation’s success. This meets our requirement to confirm that a UI element signals the completion of the underlying operation.
68-80: Validation of Correct Answer Update.
The test reattempts with an alternate answer and verifies through snapshot comparisons that the UI correctly reflects the change. This ensures that both correct and erroneous states are properly captured and validated.
86-90: Rechecking UI After Changing Answers.
The final submission cycle revalidates the UI to confirm that the correct feedback is displayed even after an initial correct attempt. This thoroughness in UI state verification enforces test robustness.system-tests/src/tests/exercises/grading/point-view.spec.ts (4)
3-5: Absolute Import Paths for Utility Functions.
The updates to use the alias (@) provide a more consistent and maintainable import strategy, aligning with the overall reorganization effort.
21-21: Appropriate Invocation of Course Prompt Handler.
CallingselectCourseInstanceIfPrompted(page)as part of the flow ensures that any prompt during course selection is automatically managed, preventing premature navigation.
29-33: UI Confirmation Post-Submission in Points View.
After clicking on the option (line 30) and submitting (line 32), the test waits for the “try again” button to appear. This serves as a confirmation that the backend operation has been processed before the test proceeds.
45-65: Snapshot Verification to Validate Points Display.
The subsequent navigation into the management screen and snapshot tests ensure that both the upper and lower portions of the points view are correctly rendered and reflect the latest state, which is essential for accurate grading feedback.system-tests/src/tests/exercises/quizzes/widget/multiple-choice-course-material-widget-column.spec.ts (7)
3-5: Uniform Import Path Standardization.
The conversion to absolute import paths using the alias enhances clarity and uniformity across the test files, making the codebase easier to navigate.
20-20: Consistent Course Instance Prompt Handling.
The use ofselectCourseInstanceIfPrompted(page)right after navigating to “Introduction to Course Material” ensures that any modal prompts are properly handled before interacting with subsequent elements.
39-48: Pre-Selection Snapshot Verification.
Taking a snapshot (withexpectScreenshotsToMatchSnapshots) before any answer is selected provides a reliable baseline of the UI state, ensuring it is fully loaded and stable before further changes.
50-56: Successful Answer Submission Flow.
The sequence of choosing “This is first option”, clicking “Submit”, and then verifying the updated state with a snapshot confirms that the backend update has been processed.
65-73: Failure Case Verification.
After resetting via “try again”, the test again verifies UI stability before simulating an incorrect choice. This careful validation using snapshots minimizes flakiness.
80-90: Post-Submission Snapshot Confirmation for Failure Case.
After simulating an incorrect answer, the test verifies that the UI reflects the failure state through snapshot comparisons. This ensures that backend mutation results are clearly communicated via the UI.
137-139: Validation of Multi-Selection Interaction.
The series of interactions with multiple answer buttons and the subsequent snapshot verification demonstrate that the multi-option logic is correctly handled and that the UI updates as expected after backend operations complete.system-tests/src/tests/course-features/feedback/give-and-manage.spec.ts (5)
4-9: Consistent Import Path Refactoring.
Updating the import paths to use the@alias for utility modules (including login/logout, feedback utilities, and screenshot functions) ensures a standardized and clean module reference throughout the file.
25-25: Effective Course-Instance Handling.
The use ofselectCourseInstanceIfPrompted(page)after navigating to the course “Introduction to feedback” ensures that any dialog prompts are managed before proceeding, which is essential for test stability.
73-76: Clear UI Confirmation Post-Feedback Submission.
By clicking “Add comment” and “Send” and then waiting for the "Feedback submitted successfully" message, the test properly confirms that the backend mutation for feedback submission has completed before moving to the admin flow.
106-114: Sequential Feedback Management Verification.
The test methodically marks feedback as read and waits (usingwaitFor({ state: "hidden" })) to confirm that each action has taken effect before proceeding. This sequential confirmation prevents duplicate interactions and aligns well with backend validation best practices.
115-127: Feedback Empty State Validation with Pre-Capture Adjustments.
Utilizing abeforeScreenshotaction to scroll to the top ensures that the UI is correctly positioned before capturing the “feedback-empty” state. Coupled with snapshot comparisons, this verifies that feedback notifications have been cleared as expected.system-tests/src/tests/exercises/peer-reviews/giving-extra-reviews.spec.ts (3)
3-3: Standardized Import Path Update
The import statement on line 3 has been updated to use the new naming convention ("./peer-review-utils"), which is consistent with the broader effort to standardize module naming across system tests.
40-70: Robust UI Confirmation in Peer Review Flow
The test correctly waits for UI confirmations after triggering peer review actions (e.g. waiting for texts like "1 / 3 Peer reviews given" and "2 / 3 Peer reviews given"). This helps ensure that backend mutations complete before subsequent actions occur.
74-98: Admin Verification Workflow Looks Solid
The admin flow—from navigating through search and course status elements to verifying the priority viatoContainText("Priority: 4")—is well structured. Please double-check that the expected priority aligns with current business rules.system-tests/src/tests/exercises/peer-reviews/manual-review-everything.spec.ts (3)
3-5: Consistent Import Path Enhancements
The changes on lines 3 and 5 update the imports for peer review utilities and iframe locators to use the standardized paths (with the new hyphenated module name and the@alias). This promotes clarity and easier maintenance in the test suite.
39-63: Effective Student Interaction Handling
The student flows—covering answer submissions, peer reviews, and subsequent UI confirmation waits—are implemented cleanly. The use ofwaitFor()on elements like "No answers available to peer review yet." ensures that the tests wait for backend updates properly.
81-112: Teacher Review Steps and Backend Mutation Confirmation
The teacher section correctly navigates through several UI elements (including course navigation and custom points submission) and waits for confirmation messages such as "Operation successful".system-tests/src/tests/exercises/peer-reviews/automatically-grade-or-manual-review-by-average.spec.ts (3)
3-5: Import Path Standardization Maintained
The updates on lines 3 and 5 replace the previous relative imports with the standardized ones (using the hyphenated module name and the@alias for iframe locators), aligning with our overall reorganization objectives.
38-63: Clear Student Workflow with UI Assurance
The test’s student flows—including answer submissions, peer reviews, and the subsequent UI refreshes—are well handled. The consistent use ofwaitFor()on key text and element states ensures that backend operations are completed before proceeding.
86-112: Strong Teacher Action Verification
The teacher operations, particularly the process of assigning custom points and validating the "Operation successful" messages, are implemented appropriately. This flow effectively confirms that backend mutations are accurately reflected in the UI.
Summary by CodeRabbit