(e2e): Cover create personal folder on web#4603
Conversation
… methods, WebThreadRobot.openMailbox no-op, waitForCondition post-create
WalkthroughAdds two abstract robot interfaces: AbstractMailboxMenuFolderRobot (folder creation actions) and AbstractMailboxAssertionRobot (expectMailboxWithNameVisible). AbstractMailboxMenuRobot now implements these interfaces. MailboxMenuRobot imports wait_for_condition, marks enterNewFolderName as Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
integration_test/scenarios/mailbox/create_personal_folder_scenario.dart (1)
25-27: ⚡ Quick winConsider 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
📒 Files selected for processing (4)
integration_test/robots/abstract/abstract_mailbox_menu_robot.dartintegration_test/robots/web/web_thread_robot.dartintegration_test/scenarios/mailbox/create_personal_folder_scenario.dartintegration_test/tests/mailbox/create_personal_folder_test.dart
|
This PR has been deployed to https://linagora.github.io/tmail-flutter/4603. |
…nuRobot methods, WebThreadRobot.openMailbox no-op, waitForCondition post-create
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
integration_test/robots/mailbox_menu_robot.dart (1)
184-189: 💤 Low valueConsider using
findsOneWidgetfor 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. UsingfindsOneWidgetwould 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
📒 Files selected for processing (5)
integration_test/robots/abstract/abstract_mailbox_assertion_robot.dartintegration_test/robots/abstract/abstract_mailbox_menu_folder_robot.dartintegration_test/robots/abstract/abstract_mailbox_menu_robot.dartintegration_test/robots/mailbox_menu_robot.dartintegration_test/scenarios/mailbox/create_personal_folder_scenario.dart
Summary by CodeRabbit
New Features
Tests