Skip to content

Commit c850865

Browse files
committed
fix(FR-1713): fix broken E2E tests and improve session test reliability (#4680)
Resolves [FR-1713](https://lablup.atlassian.net/browse/FR-1713) ## Summary This PR fixes broken E2E tests and improves session test reliability by addressing selector issues, improving test utilities, and adding comprehensive testing guidelines. ## Changes ### Session Test Improvements (`e2e/session.test.ts`) - **Fixed selectors**: Updated from `vaadin-grid-cell-content` to modern table row selectors - **Improved reliability**: Better handling of app dialogs and loading states with proper waits - **Unique session names**: Added timestamp and random string to prevent conflicts between test runs - **Menu navigation**: Fixed menu item selector from 'sessions' to 'Sessions' (case-sensitive) - **Better assertions**: Using `table rows` instead of vaadin-grid for more reliable session verification ### Test Utility Updates (`e2e/utils/test-util.ts`) - **Rewrote** **`deleteSession`** **function**: Complete refactor with modern selectors and better error handling - **Added search functionality**: Proper session search before deletion - **Navigation handling**: Ensures navigation to sessions page before attempting deletion - **Improved cleanup verification**: Better waiting for session removal confirmation ### Playwright Configuration (`playwright.config.ts`) - **Visual regression exclusion**: Added `testIgnore: "**/visual_regression/**"` to skip visual tests by default - **Improved reporters**: Different reporters for CI (html + github) vs local (html + list) environments - **Better CI integration**: HTML report configured with `open: "never"` for CI runs ### E2E Testing Guidelines (`.github/instructions/e2e.instructions.md`) - **Comprehensive 749-line guide** for AI assistants writing E2E tests - **Playwright auto-waiting principles**: Explains when to trust built-in waits vs explicit waits - **Page Object Pattern**: Examples and best practices for encapsulating page logic - **Selector strategies**: Priority order from semantic to CSS selectors - **Common patterns**: Login, modal, table, dropdown interaction examples - **Anti-patterns**: What to avoid (waitForTimeout, fragile selectors, etc.) - **Complete test examples**: Real-world test structure and debugging tips ## Test Plan Run the session creation tests: ```bash pnpm exec playwright test e2e/session.test.ts ``` Verify the tests: 1. ✅ Interactive session creation on Start page 2. ✅ Batch session creation on Start page 3. ✅ Interactive session creation on Sessions page 4. ✅ Batch session creation on Sessions page All tests should pass with: - Proper session name handling (unique names) - Reliable selectors (no flaky timeouts) - Proper cleanup (sessions verified to be created) ## Impact - **Fixed 4 broken session creation tests** - **Improved test execution reliability** by removing fragile selectors - **Better test maintainability** with updated utilities and guidelines - **Faster CI runs** by excluding visual regression tests by default - **Better developer experience** with comprehensive E2E testing documentation **Checklist:** - [x] Test reliability improved (no flaky selectors) - [x] Proper Playwright patterns (auto-waiting, semantic selectors) - [x] Updated test utilities for better maintainability - [x] Added comprehensive documentation for future test writing - [x] Visual regression tests excluded from default runs [FR-1713]: https://lablup.atlassian.net/browse/FR-1713?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent e03712d commit c850865

File tree

4 files changed

+891
-74
lines changed

4 files changed

+891
-74
lines changed

0 commit comments

Comments
 (0)