Skip to content

Conversation

@kdeakinstructure
Copy link
Contributor

@kdeakinstructure kdeakinstructure commented Dec 5, 2025

Summary

  • Added E2E test to verify that the "Pages Front Page" option in course settings is properly disabled when no front page exists
  • Implemented generic radio button assertion methods in CourseSettingsPage to check clickability based on text content
  • Added helper methods for selecting specific home page options and canceling the dialog
  • Refactored existing method names for clarity (assertHomePageChangedassertHomePageText)

Test plan

  • Run the new E2E test testCannotSelectCourseSettingsFrontPageIfNoFrontPageE2E and verify it passes
  • Verify existing E2E test testCourseSettingsE2E still passes after method refactoring
  • Verify interaction test CourseSettingsInteractionTest still passes
  • Manually test course settings home page selection dialog:
    • Verify "Pages Front Page" is disabled when no front page exists
    • Create a front page and verify the option becomes enabled
    • Remove the front page and verify the option is disabled again
    • Confirm course home falls back correctly when front page is removed

🤖 Generated with Claude Code

…election

Add E2E test to verify that the "Pages Front Page" option in course settings is disabled when no front page exists, and enabled when a front page is present.

Changes:
- Added assertRadioButtonClickable() and assertRadioButtonNotClickable() methods to CourseSettingsPage for checking radio button enabled state
- Added selectNewHomePageOption() method to select specific home page option by text
- Added cancelNewHomePageSelectionDialog() method to cancel the dialog
- Renamed assertHomePageChanged() to assertHomePageText() for clarity
- Added comprehensive E2E test testCannotSelectCourseSettingsFrontPageIfNoFrontPageE2E() that:
  * Verifies "Pages Front Page" is disabled when no front page exists
  * Creates a front page and verifies the option becomes enabled
  * Removes the front page and verifies the option is disabled again
  * Checks that course home falls back to "Course Activity Stream" when front page is removed

Technical details:
- Radio buttons are found by their text content using onViewWithText()
- Uses assertEnabled() and assertDisabled() extension functions for clickability checks
- Test covers the full lifecycle of front page creation and removal

refs: MBL-19509
affects: Teacher
release note: none

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🧪 Unit Test Results


📊 Summary

  • Total Tests: 0
  • Failed: 0
  • Skipped: 0
  • Status: ⚠️ No test results found

Last updated: Thu, 11 Dec 2025 08:46:13 GMT

@kdeakinstructure kdeakinstructure changed the title [MBL-19509][Teacher] Add test for disabled front page course home selection [MBL-19509][Teacher] - Implement E2E test for disabled front page course home selection flow Dec 5, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Review Summary - MBL-19486: Course Settings Front Page Selection

This PR adds comprehensive E2E test coverage for handling the "Pages Front Page" radio button in Course Settings when no front page exists. The implementation is solid and follows the project's testing patterns well.

✅ Strengths

  • Well-structured test: The new E2E test thoroughly covers the bug scenario with proper setup, execution, and verification
  • Good refactoring: Renamed assertHomePageChanged() to assertHomePageText() which better describes what the method does
  • Helpful utilities: Added selectNewHomePageOption(), cancelNewHomePageSelectionDialog(), assertRadioButtonClickable(), and assertRadioButtonNotClickable() methods that improve test expressiveness
  • Follows patterns: Consistent with existing test structure and page object pattern from the :espresso module
  • Proper test metadata: Tagged with @E2E, Priority.BUG_CASE, and the ticket number

📋 Minor Issues Found

  • Code duplication: The test has repetitive setup/verification logic (lines 145-174 and 193-224) that could be extracted into helper methods
  • Typos in comments: Several assertion log messages have grammatical issues with "yet" vs "now" usage
  • Consistency: Mixed phrasing across assertion messages could be standardized

Security & Performance

✅ No security concerns identified
✅ No performance issues - test uses standard Espresso patterns
✅ Proper use of data seeding API for test isolation

Test Coverage

✅ Excellent coverage of the bug scenario:

  • Tests radio button disabled state when no front page exists
  • Verifies radio button becomes enabled after creating a front page
  • Confirms fallback behavior when front page is removed
  • Validates all other radio buttons remain clickable throughout

Code Quality

The code follows Canvas Android conventions well:

  • Proper use of logging tags (STEP_TAG, ASSERTION_TAG, PREPARATION_TAG)
  • Consistent with MVVM and page object patterns
  • Good separation of concerns in page object methods
  • Appropriate use of Espresso navigation patterns

Overall, this is a quality addition that provides valuable regression protection for MBL-19486. The inline comments address minor improvements that would enhance maintainability.

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.76%
  • Master Coverage: 42.76%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.45%
  • Master Coverage: 25.45%
  • Delta: +0.00%

⚠️ Pandautils

  • PR Coverage: 22.56%
  • Master Coverage: 22.56%
  • Delta: -0.00%

📈 Overall Average

  • PR Coverage: 30.25%
  • Master Coverage: 30.25%
  • Delta: -0.00%

@adamNagy56 adamNagy56 self-requested a review December 8, 2025 08:42
Copy link
Contributor

@adamNagy56 adamNagy56 left a comment

Choose a reason for hiding this comment

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

Also, I think the teacher e2e test suit shouldn't be skipped because there is an extra test added.

@kdeakinstructure
Copy link
Contributor Author

Also, I think the teacher e2e test suit shouldn't be skipped because there is an extra test added.

Yeah, I've generated the PR with Claude and it skipped the E2E, I started it manually via Bitrise, here's the successful run:
https://app.bitrise.io/build/723432ed-a0d5-4772-b4de-365dfa3cc704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants