Repository navigation
Add IntelliJ IDEA 2026.2 UI test harness and cross-platform helpers - #9209
cj-radcliff wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request establishes a robust local integration testing setup for the Flutter IntelliJ plugin across Linux, macOS, and Windows. It introduces a base class ExistingProjectUITest for UI tests on existing projects, a platform-specific utility layer Platform, and a walkthrough step-recording helper WalkthroughSteps, alongside updated documentation. The review feedback highlights several opportunities to improve test speed and reliability: utilizing Gradle's native lazy systemProperty support, avoiding an unconditional 15-second delay when the trial tab is missing, preventing a division-by-zero crash in selectDevice when no arguments are passed, replacing a hardcoded sleep with dynamic polling when stopping the app, and defensively checking for blank FLUTTER_SDK values.
|
Also note that this includes agent skills and files to run and record UI tests in intellij |
7374c97 to
4694549
Compare
pq
left a comment
There was a problem hiding this comment.
Cool!
Is the plan to wire this into the CI or just for local runs? If the latter, maybe document it somewhere?
| `DISPLAY` and `WAYLAND_DISPLAY` are both set: | ||
|
|
||
| ```bash | ||
| FLUTTER_SDK=~/develop/flutter ./gradlew --no-daemon integration --tests io.flutter.integrationTest.ColorGutterPreviewUITest |
There was a problem hiding this comment.
I'm not sure ColorGutterPreviewUITest and NewProjectIU262UITest (also on lines 68–76, 324 and 352) exist in the repo? If that's true, maybe point these at NewProjectUITest? Or are they coming in a follow up?
There was a problem hiding this comment.
I intend it to be for local runs for now. I think eventually it can be done as part of CI or a release process, but its not there yet. My goal is to get to a point where someone can iterate pretty rapidly with an agent to build out various test flows.
| fun String.matches() = names.any { startsWith(it, ignoreCase = true) } | ||
| val selector = x( | ||
| "//div[@class='JBLabel' and (contains(@text, '(desktop)') or contains(@text, '(web)') or " + | ||
| "contains(@text, '(mobile)') or contains(@text, 'device') or contains(@text, 'Device'))]" |
There was a problem hiding this comment.
Nit: matching any label that contains device/Device, plus the fixed sleeps below, feels like we're inviting flakes. Could we target the device selector component and waitFor its state instead?
| } | ||
|
|
||
| /** The Dart plugin version installed with IntelliJ IDEA 2026.2 unless a test asks for another one. */ | ||
| const val DART_PLUGIN_VERSION_IU262 = "509.0.0" |
There was a problem hiding this comment.
gradle.properties specifies dartPluginVersion=510.0.0. Pin 510 here too (or read it from there) so they agree and don't drift?
Description
Adds the shared IntelliJ IDEA 2026.2 UI test harness, cross-platform helpers, and the
record-test-walkthroughskill as the foundation for upcoming IDE Starter UI tests:build.gradle.kts:buildPlugin.archiveFilelazily viaCommandLineArgumentProvidersoarchiveFileNameoverrides apply.-Djava.awt.headless=trueto the test runner JVM so JBR does not start Wayland toolkit threads (WLKeyboard.KeyRepeatManager) that IDE Starter'sThreadLeakTrackerreports as leaks.Setup.kt:setupTestContextIU262for IntelliJ IDEA 2026.2.3 (262.10968.63), with configurabledartPluginVersion(default509.0.0) andDART_PLUGIN_ZIPenvironment override for testing local Dart plugin builds.platform.feedback,csat.survey.enabled,editor.ux.survey.enabled).-Dawt.robot.screenshotMethod=dbusRemoteDesktopwhen running directly on a Linux Wayland desktop session so syntheticjava.awt.Robotinput routes through thexdg-desktop-portalRemoteDesktopinterface.ExistingProjectUITest.kt:flutter create), wait for indexing, dismiss the Ultimate Trial tab and survey interruptions, select devices, wait for console output, and stop running apps.utils/Platform.kt:FLUTTER_SDK,ANDROID_HOME/ANDROID_SDK_ROOT, short Windows%USERPROFILE%\fttest project directory, retry-based recursive deletion for locked Windows files, and display-mode detection).utils/WalkthroughSteps.kt&utils/NewProject.kt:waitFound()), drainsflutter createstdout beforewaitFor()so the pipe buffer cannot deadlock, and usesPlatformhelpers..agents/skills/record-test-walkthrough/&.agents/AGENTS.md:record-test-walkthroughskill (SKILL.mdandscripts/*) to record any automated UI test on its own Xvfb/Xephyr display and render a self-contained HTML + Markdown step-by-step walkthrough.testSrc/integration/README.md:FLUTTER_SDK,DART_PLUGIN_ZIP,KEEP_TEST_PROJECT,KEEP_IDE_OPEN_MINUTES), and troubleshooting.Verification
compileIntegrationKotlincompiles cleanly againstmain.tool/validate_skills.sh(skills_lint) passes on.agents/skills/record-test-walkthrough.Review the contribution guidelines below:
AUTHORSfile.CHANGELOG.mdif appropriate.