Skip to content

Upgrade Patrol to 4.5.0#4446

Merged
hoangdat merged 5 commits intomasterfrom
patrol/upgrade-4.5.0
Apr 17, 2026
Merged

Upgrade Patrol to 4.5.0#4446
hoangdat merged 5 commits intomasterfrom
patrol/upgrade-4.5.0

Conversation

@tddang-linagora
Copy link
Copy Markdown
Collaborator

@tddang-linagora tddang-linagora commented Apr 10, 2026

Objective

Prepare Patrol to implement web integration test.

Dependency

Summary by CodeRabbit

  • Tests

    • Added a cross-platform mobile back helper, exposed direct native automator access, and updated test robots/scenarios and assertions to use this unified approach for more reliable navigation and permission handling.
  • Chores

    • Upgraded test tooling and CI: Patrol deps, CLI, patrol test-directory setting, Docker/CI Flutter versions, and related scripts/workflows; bumped Android min SDK.
  • Style

    • Minor app bar theme adjustment.

@tddang-linagora tddang-linagora self-assigned this Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d58e6d6-be7a-40d9-befd-190c9109d13f

📥 Commits

Reviewing files that changed from the base of the PR and between 43c39fb and 1d2b704.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • android/app/build.gradle
  • core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart
  • integration_test/base/core_robot.dart
  • integration_test/base/test_base.dart
  • integration_test/mixin/scenario_utils_mixin.dart
  • integration_test/robots/composer_robot.dart
  • integration_test/robots/login_robot.dart
  • integration_test/robots/mailbox_menu_robot.dart
  • integration_test/scenarios/app_grid_scenario.dart
  • integration_test/scenarios/download_all_attachments_scenario.dart
  • integration_test/scenarios/email_detailed/export_attachment_scenario.dart
  • integration_test/scenarios/login_with_basic_auth_scenario.dart
  • integration_test/scenarios/send_email_with_read_receipt_enabled_scenario.dart
  • pubspec.yaml
  • scripts/patrol-integration-test-with-docker.sh
  • test/features/email/presentation/controller/single_email_controller_test.dart
💤 Files with no reviewable changes (1)
  • core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart
✅ Files skipped from review due to trivial changes (4)
  • android/app/build.gradle
  • integration_test/scenarios/download_all_attachments_scenario.dart
  • integration_test/scenarios/app_grid_scenario.dart
  • scripts/patrol-integration-test-with-docker.sh
🚧 Files skipped from review as they are similar to previous changes (9)
  • integration_test/base/core_robot.dart
  • integration_test/robots/composer_robot.dart
  • integration_test/scenarios/login_with_basic_auth_scenario.dart
  • integration_test/scenarios/send_email_with_read_receipt_enabled_scenario.dart
  • integration_test/scenarios/email_detailed/export_attachment_scenario.dart
  • integration_test/base/test_base.dart
  • integration_test/mixin/scenario_utils_mixin.dart
  • integration_test/robots/login_robot.dart
  • pubspec.yaml

Walkthrough

Refactors integration tests to use platformAutomator-backed access: adds a native getter on CoreRobot (returns platformAutomator.mobile), introduces mobileBack() for OS-specific back navigation, and updates tests/robots to use the new native access (including removing the nativeAutomator parameter from LoginRobot.grantNotificationPermission). Also updates Patrol dev dependency versions, updates Patrol CLI version in a script, bumps Flutter version references in CI/workflows and Dockerfile, and removes a @visibleForTesting annotation from an HTML viewer getter.

Possibly related PRs

  • PR 4455 (linagora/tmail-flutter): Updates Flutter version to 3.38.9 across CI/workflows and Dockerfile — aligns with the Flutter version bumps in this change.
  • PR 4452 (linagora/tmail-flutter): Implements Patrol integration-test API/config migration and Patrol upgrades — closely related to the patrol, platformAutomator, and test surface changes in this PR.

Suggested reviewers

  • dab246
  • tddang-linagora
  • codescene-delta-analysis
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade Patrol to 4.5.0' is clear, specific, and directly describes the main objective of the pull request, which is upgrading the Patrol dependency to version 4.5.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch patrol/upgrade-4.5.0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@hoangdat
Copy link
Copy Markdown
Member

why we need to change the folder name of test?

@tddang-linagora
Copy link
Copy Markdown
Collaborator Author

why we need to change the folder name of test?

https://pub.dev/packages/patrol/changelog#400

BREAKING CHANGE

Change default test directory from integration_test to patrol_test.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@dab246
Copy link
Copy Markdown
Member

dab246 commented Apr 10, 2026

why we need to change the folder name of test?

https://pub.dev/packages/patrol/changelog#400

BREAKING CHANGE
Change default test directory from integration_test to patrol_test.

Perhaps we should choose option 2 to avoid too many file changes. But in the long run, option 1 is still more useful.

Screenshot 2026-04-10 at 14 31 53 Screenshot 2026-04-10 at 14 33 37

@github-actions
Copy link
Copy Markdown

This PR has been deployed to https://linagora.github.io/tmail-flutter/4446.

@tddang-linagora
Copy link
Copy Markdown
Collaborator Author

avoid too many file changes

A lot of files "moved", I wouldn't say they "changed". The actual changes made in the PR is really small.

@dab246
Copy link
Copy Markdown
Member

dab246 commented Apr 10, 2026

avoid too many file changes

A lot of files "moved", I wouldn't say they "changed". The actual changes made in the PR is really small.

Screenshot 2026-04-10 at 15 07 27

Please look carefully and read it aloud.

@tddang-linagora
Copy link
Copy Markdown
Collaborator Author

Please look carefully and read it aloud.

Screenshot 2026-04-10 at 3 18 08 PM

@hoangdat hoangdat changed the title Upgrade Patrol to 4.5.0 [WIP] Upgrade Patrol to 4.5.0 Apr 13, 2026
@tddang-linagora tddang-linagora changed the title [WIP] Upgrade Patrol to 4.5.0 Upgrade Patrol to 4.5.0 Apr 14, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@integration_test/mixin/scenario_utils_mixin.dart`:
- Around line 293-299: The mobileBack() helper assumes any non-iOS platform is
Android and calls $.platformAutomator.android.pressBack(), which breaks on
web/desktop; update mobileBack() to explicitly branch on PlatformInfo.isAndroid
and call $.platformAutomator.android.pressBack() only for Android, call
$.platformAutomator.ios.swipeBack() only for iOS, and for all other platforms
(web/desktop) either no-op or throw a clear UnsupportedError; modify the
function containing these calls (mobileBack, PlatformInfo, and
$.platformAutomator.android/.ios references) so behavior is explicit and safe on
non-mobile platforms.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 091590c4-3260-4a7d-a098-59e4a20b0296

📥 Commits

Reviewing files that changed from the base of the PR and between eeaab49 and 48b6894.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart
  • integration_test/base/core_robot.dart
  • integration_test/base/test_base.dart
  • integration_test/mixin/scenario_utils_mixin.dart
  • integration_test/robots/composer_robot.dart
  • integration_test/robots/login_robot.dart
  • integration_test/robots/mailbox_menu_robot.dart
  • integration_test/scenarios/app_grid_scenario.dart
  • integration_test/scenarios/download_all_attachments_scenario.dart
  • integration_test/scenarios/email_detailed/export_attachment_scenario.dart
  • integration_test/scenarios/login_with_basic_auth_scenario.dart
  • integration_test/scenarios/send_email_with_read_receipt_enabled_scenario.dart
  • pubspec.yaml
💤 Files with no reviewable changes (1)
  • core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart

Comment thread integration_test/mixin/scenario_utils_mixin.dart
codescene-delta-analysis[bot]

This comment was marked as outdated.

@tddang-linagora tddang-linagora changed the base branch from master to upgrade/flutter-3.38.9 April 16, 2026 06:54
codescene-delta-analysis[bot]

This comment was marked as outdated.

chibenwa
chibenwa previously approved these changes Apr 16, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

dab246
dab246 previously approved these changes Apr 17, 2026
Copy link
Copy Markdown
Member

@dab246 dab246 left a comment

Choose a reason for hiding this comment

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

lgtm

@hoangdat hoangdat changed the base branch from upgrade/flutter-3.38.9 to master April 17, 2026 10:45
@hoangdat hoangdat dismissed stale reviews from dab246 and chibenwa April 17, 2026 10:45

The base branch was changed.

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@hoangdat hoangdat merged commit e3dfadc into master Apr 17, 2026
25 checks passed
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.

4 participants