Skip to content

[MBL-19712][Teacher] Extend Profile Settings E2E tests with empty name field and profile picture change#3523

Open
adamNagy56 wants to merge 3 commits intomasterfrom
MBL-19712-Extend-Profile-Settings-E2E-test
Open

[MBL-19712][Teacher] Extend Profile Settings E2E tests with empty name field and profile picture change#3523
adamNagy56 wants to merge 3 commits intomasterfrom
MBL-19712-Extend-Profile-Settings-E2E-test

Conversation

@adamNagy56
Copy link
Contributor

Summary

Extend Profile Settings E2E tests to validate empty name field behavior and profile picture change flow with crop functionality.

refs: MBL-19712
affects: Teacher
release note:

Checklist

  • Run E2E test suite

…or and profile picture change flow with crop functionality.

refs: MBL-19712
affects: Teacher
release note:
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

This PR adds two new E2E tests for the Profile Settings functionality in the Teacher app:

  1. Testing empty profile name handling (verification that clearing the name field preserves the previous value)
  2. Testing profile picture change from gallery

Positive aspects:

  • Good test coverage for profile settings edge cases
  • Well-structured test methods with clear logging for each step
  • Proper use of assertions to verify expected behavior
  • Good reuse of page object pattern with new helper methods

Issues to address:

  • Exception handling workaround (SettingsE2ETest.kt:221, 285): The try-catch blocks catching IllegalStateException appear to be workarounds for flaky navigation. Consider extracting this into a helper method or using more robust waiting/navigation strategies.

  • Intents lifecycle management (SettingsE2ETest.kt:267): Intents.init() and Intents.release() should ideally be managed at test lifecycle level using @Before/@After or IntentsRule for better resource management.

  • Assertion mechanism (EditProfileSettingsPage.kt:75): Using raw assert() in Android instrumentation tests is problematic as assertions can be disabled at runtime. Use Espresso's assertion mechanisms or proper assertion libraries instead.

  • Null safety (TeacherTest.kt:196): Missing null check for externalCacheDir which could cause issues if the cache directory is unavailable. Should handle this case gracefully.

Minor observations:

  • The stubImagePickerIntent() method is a good addition for testing file selection flows
  • The new page object methods follow existing patterns well
  • Test logging is comprehensive and helpful for debugging

Overall, this is a solid addition to the test suite. The main concerns are around test reliability and proper assertion usage. Once these are addressed, this will be ready to merge.

fun stubImagePickerIntent(fileName: String) {
val resultData = Intent()
val dir = activityRule.activity.externalCacheDir
val file = File(dir?.path, fileName)
Copy link

Choose a reason for hiding this comment

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

Missing null safety check. If externalCacheDir is null, file will be created with a null path, which could lead to unexpected behavior or crashes. Consider:

val dir = activityRule.activity.externalCacheDir 
    ?: throw IllegalStateException("External cache directory not available")
val file = File(dir.path, fileName)

refs: MBL-19712
affects: Teacher
release note:
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

🧪 Unit Test Results

✅ 📱 Teacher App

  • Tests: 373 total, 0 failed, 0 skipped
  • Duration: 33.380s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2983 total, 0 failed, 0 skipped
  • Duration: 52.915s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 3356
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Thu, 12 Feb 2026 15:52:15 GMT

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

📊 Code Coverage Report

✅ Student

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

✅ Teacher

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

✅ Pandautils

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

📈 Overall Average

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

@github-actions
Copy link

Teacher Install Page

import com.instructure.espresso.page.withId
import com.instructure.espresso.typeText
import com.instructure.teacher.R
import com.instructure.pandautils.R as PandaUtilsR
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to import an other R file? As far as I know resources and ids are merged after build.

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