Skip to content

(e2e): Cover create personal folder on web#4603

Open
dab246 wants to merge 2 commits into
masterfrom
feat/e2e-create-personal-folder-web
Open

(e2e): Cover create personal folder on web#4603
dab246 wants to merge 2 commits into
masterfrom
feat/e2e-create-personal-folder-web

Conversation

@dab246

@dab246 dab246 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Improved mailbox folder creation flow with end-to-end checks and a visible confirmation for newly created folders.
    • Web desktop: mailbox sidebar is kept visible without a separate open action.
  • Tests

    • Added/updated tests to make folder-creation checks more robust.
    • Extended test coverage to Android, iOS, and Web.

… methods, WebThreadRobot.openMailbox no-op, waitForCondition post-create
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds two abstract robot interfaces: AbstractMailboxMenuFolderRobot (folder creation actions) and AbstractMailboxAssertionRobot (expectMailboxWithNameVisible). AbstractMailboxMenuRobot now implements these interfaces. MailboxMenuRobot imports wait_for_condition, marks enterNewFolderName as @override, and implements expectMailboxWithNameVisible that waits for the mailbox item then asserts presence. WebThreadRobot adds a no-op openMailbox override for web. CreatePersonalFolderScenario is refactored to use scenario-provided robots and a class-level folder name; the test imports TestTags and adds Android/iOS/Web tags to runPatrolTest.

Possibly related PRs

Suggested reviewers

  • tddang-linagora
  • hoangdat
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding web platform support for the 'create personal folder' end-to-end test, which aligns with the PR's objective to extend test coverage to the web platform.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/e2e-create-personal-folder-web

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
integration_test/scenarios/mailbox/create_personal_folder_scenario.dart (1)

25-27: ⚡ Quick win

Consider selector specificity if multiple elements could match.

The selector $(name) matches elements by text content. If multiple UI elements contain the folder name (e.g., in breadcrumbs, headers, or duplicate mailbox entries), evaluate() might return multiple results, potentially matching unintended elements.

If selector specificity becomes an issue during testing, consider using a more specific selector:

// Example: constrain by widget type or ancestor
await waitForCondition(
  () async => $(MailboxListItem).$(name).evaluate().isNotEmpty,
);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration_test/scenarios/mailbox/create_personal_folder_scenario.dart`
around lines 25 - 27, The current waitForCondition uses the loose text selector
$(name).evaluate() which can match multiple UI elements (breadcrumbs, headers,
duplicates); change the selector to a more specific one (e.g., constrain by
widget type or ancestor) so you target the intended mailbox item—update the call
that uses waitForCondition and $(name).evaluate() to nest the selector under a
specific widget like MailboxListItem or another ancestor to ensure evaluate()
returns the intended element only.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@integration_test/scenarios/mailbox/create_personal_folder_scenario.dart`:
- Around line 25-27: The current waitForCondition uses the loose text selector
$(name).evaluate() which can match multiple UI elements (breadcrumbs, headers,
duplicates); change the selector to a more specific one (e.g., constrain by
widget type or ancestor) so you target the intended mailbox item—update the call
that uses waitForCondition and $(name).evaluate() to nest the selector under a
specific widget like MailboxListItem or another ancestor to ensure evaluate()
returns the intended element only.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8565d86e-274a-41e4-acc0-3e3b0b60dc53

📥 Commits

Reviewing files that changed from the base of the PR and between c846a0d and 47e8705.

📒 Files selected for processing (4)
  • integration_test/robots/abstract/abstract_mailbox_menu_robot.dart
  • integration_test/robots/web/web_thread_robot.dart
  • integration_test/scenarios/mailbox/create_personal_folder_scenario.dart
  • integration_test/tests/mailbox/create_personal_folder_test.dart

@github-actions

Copy link
Copy Markdown

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

Comment thread integration_test/robots/abstract/abstract_mailbox_menu_robot.dart Outdated
…nuRobot methods, WebThreadRobot.openMailbox no-op, waitForCondition post-create

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

Copy link
Copy Markdown

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.

@dab246 dab246 requested a review from hoangdat June 11, 2026 04:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
integration_test/robots/mailbox_menu_robot.dart (1)

184-189: 💤 Low value

Consider using findsOneWidget for more precise mailbox verification.

The current implementation uses findsWidgets, which passes if one or more widgets match. For a mailbox name, you'd typically expect exactly one match. Using findsOneWidget would catch unexpected duplicates and provide more precise verification.

♻️ Optional refinement
 `@override`
 Future<void> expectMailboxWithNameVisible(String name) async {
   final mailboxItem = $(MailboxItemWidget).$(LabelMailboxItemWidget).$(name);
   await waitForCondition(() async => mailboxItem.evaluate().isNotEmpty);
-  expect(mailboxItem, findsWidgets);
+  expect(mailboxItem, findsOneWidget);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@integration_test/robots/mailbox_menu_robot.dart` around lines 184 - 189, The
test uses findsWidgets which allows multiple matches; in
expectMailboxWithNameVisible change the assertion to expect exactly one match by
replacing expect(mailboxItem, findsWidgets) with expect(mailboxItem,
findsOneWidget) so the function expectMailboxWithNameVisible (and the
mailboxItem locator built from MailboxItemWidget -> LabelMailboxItemWidget ->
name) will fail on duplicates and ensure a single mailbox is visible.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@integration_test/robots/mailbox_menu_robot.dart`:
- Around line 184-189: The test uses findsWidgets which allows multiple matches;
in expectMailboxWithNameVisible change the assertion to expect exactly one match
by replacing expect(mailboxItem, findsWidgets) with expect(mailboxItem,
findsOneWidget) so the function expectMailboxWithNameVisible (and the
mailboxItem locator built from MailboxItemWidget -> LabelMailboxItemWidget ->
name) will fail on duplicates and ensure a single mailbox is visible.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1c724b1-77e8-4725-9afa-f876cfd63286

📥 Commits

Reviewing files that changed from the base of the PR and between 47e8705 and d4e27b6.

📒 Files selected for processing (5)
  • integration_test/robots/abstract/abstract_mailbox_assertion_robot.dart
  • integration_test/robots/abstract/abstract_mailbox_menu_folder_robot.dart
  • integration_test/robots/abstract/abstract_mailbox_menu_robot.dart
  • integration_test/robots/mailbox_menu_robot.dart
  • integration_test/scenarios/mailbox/create_personal_folder_scenario.dart

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.

2 participants