ui-testing
БесплатноБез исполняемых скриптовНе проверенTestFX patterns for JavaFX controller testing in Xeres including FXML loading with controller factories, mocking reactive clients, and user interaction testing.
от zapek★ 224 звезды на GitHubОб этом скилле
UI Testing Patterns for Xeres
TestFX Setup
UI tests use TestFX with both ApplicationExtension and MockitoExtension:
@ExtendWith({ApplicationExtension.class, MockitoExtension.class})
class ContactViewControllerTest
{
@Mock
private ProfileClient profileClient;
@InjectMocks
private ContactViewController controller;
@Test
void testFxmlLoading() throws IOException
{
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/contact/contact_view.fxml"));
loader.setControllerFactory(_ -> controller);
Parent root = loader.load();
assertThat(root).isNotNull();
}
}
FXTest Base Class
For tests requiring JavaFX initialization, extend FXTest:
class SomeJavaFXTest extends FXTest
{
@Test
void test()
{
}
}
FXML Loading Pattern
@Test
void initialize_ShouldLoadContacts() throws IOException
{
// Load FXML with controller factory
FXMLLoader loader = new FXMLLoader(
getClass().getResource("/view/contact/contact_view.fxml")
);
loader.setControllerFactory(javaClass -> controller);
// Initialize controller manually for unit-like tests
controller.initialize();
// Verify initial state
assertThat(controller.getContactTreeTableView()).isNotNull();
}
Testing User Interactions
@Test
void clickButton_ShouldTriggerAction()
{
// Find button in loaded FXML
var button = lookup("#saveButton").query();
// Click and verify
clickOn(button);
// Verify interaction with mock
verify(profileClient).save(any(Profile.class));
}
Mocking Reactive Clients
For WebClient-based clients returning Mono:
@Test
void foobar()
{
when(profileClient.findById(anyLong())).thenReturn(Mono.just(testProfile));
}
See Also
junit-testingskill for basic testing patternsjavafx-patternsskill for controller structure
Установить ui-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ui-testing?
TestFX patterns for JavaFX controller testing in Xeres including FXML loading with controller factories, mocking reactive clients, and user interaction testing.
Как установить скилл ui-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ui-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic