Summary
The current jmix-testing skill covers Unit, Integration, and @UiTest testing well, but has several gaps that would make it more complete and actionable for AI agents.
Proposed Changes
1. Add Test Type Comparison Table
Add a quick-reference table at the top so agents can immediately pick the right approach:
|
Unit |
Integration |
UI Integration (@UiTest) |
End-to-End (Masquerade) |
| Spring context |
No |
Yes |
Yes |
No (runs against live app) |
| Browser |
No |
No |
No |
Yes (Selenide/Selenium) |
| Speed |
Fastest |
Fast |
Medium |
Slowest |
| What it tests |
Pure logic |
Service layer + DB |
Server-side Vaadin component tree |
Real user-facing UI |
| Best for |
Calculators, validators |
Service methods, data access |
View logic, navigation, data binding |
Critical user flows, login, CRUD |
2. Add End-to-End UI Tests (Masquerade) Section
Completely missing from the current skill. Should cover:
- Setup:
testImplementation 'io.jmix.masquerade:jmix-masquerade' and jmix.ui.ui-test-mode=true
- Project structure:
ui_autotest/ package for tests, test_support/view/ for wrappers
- View wrappers:
@TestView, extending io.jmix.masquerade.sys.View<T>
- Component wiring:
@TestComponent (preferred, uses j-test-id) vs @FindBy (Selenium, for raw HTML)
- Writing tests:
Selenide.open(), Masquerade.$j(), Selenide assertions
- Imports: All key packages (
io.jmix.masquerade.Masquerade, io.jmix.masquerade.TestView, io.jmix.masquerade.component.*)
- Selenide configuration:
baseUrl, timeout, headless setup in @BeforeAll
- Fragments: Accessing composites via
$j(FragmentWrapper.class)
3. Clarify @TestComponent vs @FindBy
This is the most confusing part for agents. The skill should explain:
@TestComponent (io.jmix.masquerade.TestComponent) is Masquerade's annotation — field name matches j-test-id by default. Use path attribute for nested/renamed elements.
@FindBy (org.openqa.selenium.support.FindBy) is a Selenium annotation, NOT Masquerade. Use only for elements without j-test-id (e.g., native Vaadin login form).
- The
j-test-id HTML attribute is generated when jmix.ui.ui-test-mode=true.
4. Add Key Packages Table
| Class |
Package |
Purpose |
Masquerade |
io.jmix.masquerade |
Entry point — $j() methods |
@TestView |
io.jmix.masquerade |
View wrapper annotation |
@TestComponent |
io.jmix.masquerade |
Component field wiring by j-test-id |
View<T> |
io.jmix.masquerade.sys |
Base class for view wrappers |
Button, TextField, etc. |
io.jmix.masquerade.component |
Component wrappers |
@FindBy |
org.openqa.selenium.support |
Selenium locator (not Masquerade) |
5. Minor Fixes
- Add
@ExtendWith(AuthenticatedAsAdmin.class) to the integration test examples (currently missing — agents copy these examples and miss the auth annotation)
- Expand "When to Use" to include Masquerade triggers
- Add doc reference links:
https://docs.jmix.io/jmix/testing/ui-integration-tests.html and https://docs.jmix.io/jmix/testing/masquerade.html
- Clarify
@UiTest behavior: explain it starts Vaadin + configures views + sets up auth (currently just shows code)
- Add
jmix.ui.ui-test-mode=true to checklist when using Masquerade
References
Summary
The current
jmix-testingskill covers Unit, Integration, and@UiTesttesting well, but has several gaps that would make it more complete and actionable for AI agents.Proposed Changes
1. Add Test Type Comparison Table
Add a quick-reference table at the top so agents can immediately pick the right approach:
@UiTest)2. Add End-to-End UI Tests (Masquerade) Section
Completely missing from the current skill. Should cover:
testImplementation 'io.jmix.masquerade:jmix-masquerade'andjmix.ui.ui-test-mode=trueui_autotest/package for tests,test_support/view/for wrappers@TestView, extendingio.jmix.masquerade.sys.View<T>@TestComponent(preferred, usesj-test-id) vs@FindBy(Selenium, for raw HTML)Selenide.open(),Masquerade.$j(), Selenide assertionsio.jmix.masquerade.Masquerade,io.jmix.masquerade.TestView,io.jmix.masquerade.component.*)baseUrl,timeout,headlesssetup in@BeforeAll$j(FragmentWrapper.class)3. Clarify
@TestComponentvs@FindByThis is the most confusing part for agents. The skill should explain:
@TestComponent(io.jmix.masquerade.TestComponent) is Masquerade's annotation — field name matchesj-test-idby default. Usepathattribute for nested/renamed elements.@FindBy(org.openqa.selenium.support.FindBy) is a Selenium annotation, NOT Masquerade. Use only for elements withoutj-test-id(e.g., native Vaadin login form).j-test-idHTML attribute is generated whenjmix.ui.ui-test-mode=true.4. Add Key Packages Table
Masqueradeio.jmix.masquerade$j()methods@TestViewio.jmix.masquerade@TestComponentio.jmix.masqueradej-test-idView<T>io.jmix.masquerade.sysButton,TextField, etc.io.jmix.masquerade.component@FindByorg.openqa.selenium.support5. Minor Fixes
@ExtendWith(AuthenticatedAsAdmin.class)to the integration test examples (currently missing — agents copy these examples and miss the auth annotation)https://docs.jmix.io/jmix/testing/ui-integration-tests.htmlandhttps://docs.jmix.io/jmix/testing/masquerade.html@UiTestbehavior: explain it starts Vaadin + configures views + sets up auth (currently just shows code)jmix.ui.ui-test-mode=trueto checklist when using MasqueradeReferences
jmix-masquerade/src/main/java/io/jmix/masquerade/in jmix-framework/jmix repo