Skip to content

Improve jmix-testing skill: add Masquerade E2E, test type comparison, and fix gaps#7

Open
edurbs wants to merge 1 commit into
jmix-framework:mainfrom
edurbs:improve-jmix-testing-skill
Open

Improve jmix-testing skill: add Masquerade E2E, test type comparison, and fix gaps#7
edurbs wants to merge 1 commit into
jmix-framework:mainfrom
edurbs:improve-jmix-testing-skill

Conversation

@edurbs
Copy link
Copy Markdown

@edurbs edurbs commented May 16, 2026

Summary

  • Add test type comparison table for quick reference (Unit / Integration / UI Integration / Masquerade)
  • Add End-to-End UI Tests (Masquerade) section covering setup, view wrappers, writing tests, imports, Selenide configuration, and fragments
  • Clarify @TestComponent vs @FindBy distinction (Masquerade vs Selenium annotations)
  • Add Key Packages table mapping every annotation/class to its package
  • Fix integration test examples to include @ExtendWith(AuthenticatedAsAdmin.class)
  • Add doc reference links for both UI integration tests and Masquerade
  • Clarify @UiTest behavior in the section description
  • Update checklist and forbidden sections

Closes #6

Changes

Test Type Comparison (new)

A quick-reference table so agents immediately pick the right approach instead of guessing between @UiTest and Masquerade.

Masquerade Section (new)

Complete coverage of the Masquerade E2E testing library:

  • Setup: Gradle dependency + jmix.ui.ui-test-mode=true + Selenide configuration
  • Project structure: ui_autotest/ for tests, test_support/view/ for wrappers
  • View wrappers: @TestView, extending io.jmix.masquerade.sys.View<T>
  • Component wiring: @TestComponent (preferred) vs @FindBy (Selenium fallback)
  • Writing tests: Full example with imports, Selenide.open(), Masquerade.$j(), Selenide assertions
  • Key API: All $j() overloads documented
  • Fragments: Accessing composites via $j(WrapperClass.class)

@TestComponent vs @FindBy Clarification (new)

Explains the most confusing aspect for agents:

  • @TestComponent is Masquerade's annotation — field name matches j-test-id by default
  • @FindBy is a Selenium annotation (org.openqa.selenium.support) — use only for elements without j-test-id
  • The j-test-id HTML attribute is generated when jmix.ui.ui-test-mode=true

Minor Fixes

  • Integration test examples now include @ExtendWith(AuthenticatedAsAdmin.class) (was missing — agents would copy without auth)
  • Doc reference URLs added
  • @UiTest section now explains what the annotation does
  • Checklist updated with Masquerade-specific items

References

… fix gaps

- Add test type comparison table for quick reference
- Add End-to-End UI Tests (Masquerade) section with setup, view wrappers,
  writing tests, imports, Selenide config, and fragments
- Clarify @TestComponent vs @findby distinction
- Add Key Packages table mapping annotations/classes to packages
- Add @ExtendWith(AuthenticatedAsAdmin.class) to integration test examples
- Add doc reference links for UI integration tests and Masquerade
- Clarify @uitest behavior (starts Vaadin + configures views + auth)
- Update checklist and forbidden sections

Closes jmix-framework#6
@Fedoseew Fedoseew requested a review from knstvk May 18, 2026 08:54
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.

Improve jmix-testing skill: add Masquerade E2E, test type comparison, and fix gaps

1 participant