idf-eclipse-plugin icon indicating copy to clipboard operation
idf-eclipse-plugin copied to clipboard

WIP: SWTBot test case: Serial Monitor verification

Open AndriiFilippov opened this issue 3 months ago • 1 comments

Description

SWTBot Serial Monitor test cases

Fixes # (IEP-1624)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Dependent components impacted by this PR:

  • Component 1
  • Component 2

Checklist

  • [ ] PR Self Reviewed
  • [ ] Applied Code formatting
  • [ ] Added Documentation
  • [ ] Added Unit Test
  • [ ] Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • Tests
    • Added end-to-end UI test for the Serial Monitor workflow on newly created projects (create, build, flash, verify output).
    • Enhanced test utilities to improve terminal/console handling, flash completion detection, and text-wait conditions.
    • Introduced a dedicated flash wait timeout in Linux test configurations to improve stability and timing.
    • Improved synchronization and reliability across UI-driven test flows.

AndriiFilippov avatar Aug 27 '25 11:08 AndriiFilippov

Walkthrough

Adds a Linux test config flash timeout, introduces a new SWTBot UI test for Serial Monitor flow, extends ProjectTestOperations with terminal/flash wait helpers, and adds a text-contains wait utility for terminal content scanning.

Changes

Cohort / File(s) Summary
Test configuration
tests/com.espressif.idf.ui.test/configs/default-test-linux.properties
Adds property default.project.flash.wait=60000.
Test wait utilities
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/common/utility/TestWidgetWaitUtility.java
Adds waitUntilTextContains(...) to wait for case-insensitive text in Terminal view; minor whitespace tweak.
Project operations (helpers)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/operations/ProjectTestOperations.java
Adds waitForProjectMonitorAndDisconnect, findTextInSerialMonitorOutput, viewTerminal, waitProjectFlash; enhances viewConsole to select console via dropdown.
Executable UI test
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSerialMonitorTest.java
New SWTBot JUnit test covering create → build → flash → serial monitor verification flow, with setup/teardown and dialog handling.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Tester
  participant SWTBot as SWTBot Runner
  participant IDE as Eclipse IDE
  participant Ops as ProjectTestOperations
  participant Util as TestWidgetWaitUtility
  participant Console as Console View
  participant Terminal as Terminal View

  Tester->>SWTBot: Run NewEspressifIDFProjectSerialMonitorTest
  SWTBot->>IDE: Create new ESP-IDF project
  SWTBot->>IDE: Build project via context menu
  Ops->>Console: viewConsole("Build Console")
  Ops->>Console: Wait for build completion

  SWTBot->>IDE: Open Run Configurations and Launch Flash
  Ops->>Console: viewConsole("ESP-IDF Console")
  Ops->>Console: waitProjectFlash (wait for "Hard resetting via RTS pin...")

  Ops->>Terminal: viewTerminal("Serial", timeout)
  Util->>Terminal: waitUntilTextContains("Hello", timeout)
  Ops->>Terminal: Disconnect terminal

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • espressif/idf-eclipse-plugin#1123 — Also modifies TestWidgetWaitUtility with wait methods and adds SWTBot tests, overlapping utility patterns.

Suggested reviewers

  • kolipakakondal
  • alirana01

Poem

I built, I flashed—ears all a-quiver,
Watching the console’s texty river.
A “Hello” hops across the screen,
Terminal whispers, bright and clean.
Timeouts set, the waits align—
Carrots for logs; results divine. 🥕🐇

[!TIP]

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch IEP-1624

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Aug 27 '25 11:08 coderabbitai[bot]