Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Fix and re-enable exam mode e2e tests #8946

Merged
merged 8 commits into from
Jul 2, 2024

Conversation

SimonEntholzer
Copy link
Contributor

@SimonEntholzer SimonEntholzer commented Jul 2, 2024

Checklist

General

Motivation and Context

The exam mode e2e tests are broken, as a new UI was introduced.

Description

This PR fixes the outdated exam mode e2e tests.

Steps for Testing

Prerequisites:

  • make sure that all playwright tests pass (see below, multi/single node.., run locally)

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests (check out the test logs below)

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • New Features

    • Improved navigation and interaction within exams, including refined URL handling and timing validations.
    • Enhanced exam participation flow using the navigation sidebar and exercise titles.
    • Added methods for editing and deleting test exam runs.
  • Bug Fixes

    • Fixed issues with exercise opening and saving logic during exams.
    • Corrected URL patterns and navigation steps for exam-related pages.
  • Refactor

    • Replaced index-based exercise navigation with title-based navigation.
    • Adjusted method names and parameters for better clarity and functionality.
  • Chores

    • Removed outdated testIgnore configuration for exam tests in Playwright configuration.

Copy link

coderabbitai bot commented Jul 2, 2024

Walkthrough

The modifications involve several refinements and consistency improvements to the exam handling and exercise navigation processes in an end-to-end testing scenario. Changes include shifting from index-based to title-based exercise opening, updating URL navigation patterns, enhancing timing validations, and streamlining navigation flows within exams. These updates aim to improve the robustness and readability of the test scripts, ensuring more precise interactions and verifications for exam-related functionalities.

Changes

File Change Summary
src/test/playwright/e2e/exam/ExamDateVerification.spec.ts Refined exam navigation, URL handling, and timing validations for exam interactions.
src/test/playwright/e2e/exam/ExamParticipation.spec.ts & src/test/playwright/e2e/exam/ExamResults.spec.ts Adjusted exercise opening and saving methods to utilize exam titles rather than indices.
src/test/playwright/support/pageobjects/course/CourseOverviewPage.ts Modified method to open an exam by title instead of ID.
src/test/playwright/support/pageobjects/exam/ExamExerciseGroupsPage.ts Added method clickEditGroupForTestExam to handle specific group edits.
src/test/playwright/support/pageobjects/exam/ExamNavigationBar.ts Updated methods for exercise navigation by title and added new overview methods.
src/test/playwright/support/pageobjects/exam/ExamParticipationPage.ts Adjusted URL navigation logic and exam start processes.
src/test/playwright/support/pageobjects/exam/ExamTestRunPage.ts Added method deleteTestExamTestRun for test exam deletion.
src/test/playwright/support/pageobjects/exercises/text/TextEditorPage.ts Modified checkCurrentContent method to remove exerciseID parameter.
src/test/playwright/e2e/exam/test-exam (multiple files) Streamlined exam navigation, submission handling, and student exam checks, incorporating title-based navigation methods.
src/test/playwright/playwright.config.ts Removed testIgnore configuration related to exam page tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CoursePage
    participant ExamPage
    participant Exercise

    User ->> CoursePage: Open Exams Tab
    CoursePage ->> ExamPage: Open Exam by Title
    ExamPage ->> Exercise: Open First Exercise by Title
    User ->> Exercise: Submit & Save Exercise
    Exercise ->> ExamPage: Indicate Exercise Saved
    ExamPage ->> ExamPage: Handle Timing Validations
    User ->> Exercise: Open Another Exercise by Title
Loading

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 9431ade and e6647b8.

Files selected for processing (1)
  • src/test/playwright/e2e/exam/ExamDateVerification.spec.ts (3 hunks)
Additional context used
Biome
src/test/playwright/e2e/exam/ExamDateVerification.spec.ts

[error] 79-79: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 81-81: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 84-84: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 86-86: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 86-86: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 88-88: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 90-90: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 111-111: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 114-114: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 116-116: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 116-116: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


[error] 117-117: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)

Additional comments not posted (2)
src/test/playwright/e2e/exam/ExamDateVerification.spec.ts (2)

117-117: Avoid using non-null assertion operator.

Replace exercise.title! with a safer alternative, such as optional chaining or nullish coalescing.

- await examNavigation.openOrSaveExerciseByTitle(exercise.title!);
+ await examNavigation.openOrSaveExerciseByTitle(exercise.title ?? '');

Likely invalid or redundant comment.

Tools
Biome

[error] 117-117: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


93-94: Reduce exam end time cautiously.

The exam end time has been reduced from 30 seconds to 10 seconds. Ensure this change does not cause timing issues in the tests.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SimonEntholzer SimonEntholzer changed the title General: fix and re-enable exam mode e2e tests General: Fix and re-enable exam mode e2e tests Jul 2, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 24

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 2, 2024
egekurt123
egekurt123 previously approved these changes Jul 2, 2024
Copy link
Contributor

@egekurt123 egekurt123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally a lot of exam tests seam to fail: https://bamboo.ase.in.tum.de/browse/ARTEMIS-AEPTMA585-2/test
Is this related to this PR?

src/test/playwright/e2e/exam/ExamParticipation.spec.ts Outdated Show resolved Hide resolved
src/test/playwright/e2e/exam/ExamTestRun.spec.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

@SimonEntholzer
Copy link
Contributor Author

SimonEntholzer commented Jul 2, 2024

Additionally a lot of exam tests seam to fail: https://bamboo.ase.in.tum.de/browse/ARTEMIS-AEPTMA585-2/test Is this related to this PR?

Yea some tests were not fixed yet at that point

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 19

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

@krusche krusche changed the title General: Fix and re-enable exam mode e2e tests Development: Fix and re-enable exam mode e2e tests Jul 2, 2024
@krusche krusche added this to the 7.3.1 milestone Jul 2, 2024
@krusche krusche merged commit 62f0910 into develop Jul 2, 2024
16 of 18 checks passed
@krusche krusche deleted the chore/fix-exam-e2e-tests branch July 2, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants