- Deep Check Error Handling: Fixed an issue where
deep_checkwould fail to captureActionView::Template::Error(and other rendering errors) in components that return aHashpayload (common in newer ViewComponent versions). The checker now correctly extracts the component from the hash and properly renders it to detect failures. [PR #123]
- Force Update: Added support for forcibly updating all baselines via
rake lookbook:test[force]orUPDATE=true rake lookbook:test.
- File Naming: Improved screenshot file naming to use full directory paths (e.g.,
folder/component/preview.png) instead of flattened underscores. This prevents filename clashes between components with similar names in different namespaces (e.g.,Foo::BarvsFooBar) and preserves directory structure in the output.
- Deep Check: Ensure
ActionView::Template::Erroris correctly reported as a failure inrake lookbook:deep_check. This fixes an issue where rendered error pages were being ignored.
- AI-Native Inspection Tools: Added
lookbook:inspectandlookbook:contextRake tasks to assist AI agents in understanding preview structure and code context. - Debug Artifacts: Automatically save HTML DOM snapshots alongside failed visual regression tests for easier debugging.
- Visual Tolerance: Added
toleranceconfiguration option and fuzzy matching (Euclidean distance) toImageComparatorto reduce flakiness.
- Flaky Screenshots: Added
wait_timeconfiguration toLookbookVisualTester.configto allow explicit waiting before screenshot capture. This resolves blank or layout-only screenshots in slower environments. - Robust Driver: Updated
FerrumDriverto include consistent network idle checks and support the newwait_timeoption.
- Image Comparison: Fixed
Dimensions mismatcherror by creating a diff canvas sized to the maximum dimensions of widely differing images. - Missing Action Error: Resolved
ActionNotFoundforrender_scenario_to_stringby ensuring the preview controller properly includesLookbook::PreviewControllerActions. - Unexpected Headers: Fixed an issue where the
example_iconspreview in the dummy app included an unwanted<h1>Icons</h1>header. - Spec Fix: Resolved a
SystemStackError(circular dependency) inScenarioFinderspecs.
- Folder Structure: Refactored screenshot organization. Non-variant screenshots are now stored in a
defaultsubfolder withincoverage/screenshots. - Deep Check: Enhanced
rake lookbook:deep_checkto validate that the configured preview controller supports required Lookbook actions.
- Image Comparison: Fixed
Dimensions mismatcherror. Now, when images have different dimensions, a diff image is generated on a canvas sized to the maximum dimensions, clearly showing the differences and the mismatched areas.
- Folder Structure: Screenshots are now saved in
coverage/screenshotsby default (previouslyspec/visual_screenshots). - Default Subfolder: Non-variant screenshots are now stored in a
defaultsubfolder to maintain consistency with variant-based runs.
- Variants URL Generation: Fixed a bug where setting
VARIANTScaused aJSON::ParserErrorin Lookbook. Variant parameters are now correctly serialized to JSON in the preview URL.
- Deep Check:
rake lookbook:deep_checknow correctly detects and fails when a preview returnsnil(implicit rendering) but the corresponding template is missing (ViewComponent::MissingPreviewTemplateError). - Deep Check:
rake lookbook:deep_checknow exits with status 1 if any errors or failures are detected.
- Preview Checker: Fixed a
NoMethodErrorcrash inPreviewCheckerwhen encountering template-only Lookbook scenarios (scenarios without a corresponding method in the preview class).
- Deprecation Warning: Replaced usage of
exampleswithscenariosto resolve Lookbook deprecation warnings.
- Preview Health Checks: Added new Rake tasks to verify preview integrity:
lookbook:check: Rapidly checks if previews load and instantiate without errors.lookbook:deep_check: Verified previews by effectively rendering them to catch runtime and template errors.lookbook:missing: Identifies ViewComponents that lack a corresponding preview.
- Parallel Preview Checks: Health checks run in parallel using
concurrent-ruby. - Comprehensive Reporting: Checks generate colored terminal output and a detailed HTML report (
coverage/preview_check_report.html) including timing stats and slowest previews. - Custom Deep Check Setup: Added
config.preview_checker_setupto allow defining mocks (e.g., User, Warden) required for deep checking.
- Multiple Screenshot Variants: Support for defining screenshot variants (e.g., specific viewports, themes) using Lookbook's
preview_display_options.- Configurable via
VARIANTSenvironment variable (JSON array). - Screenshots are saved in subdirectories corresponding to the variant options.
- Automatic browser resizing based on
widthoptions.
- Configurable via
- Removed Minitest: Switched completely to RSpec for internal testing. Deleted unused Minitest files and configuration.
- Concurrent Screenshot Capture: Speed up your test suite significantly by running screenshot capture in parallel.
- Enabled by default with 4 threads.
- Configurable via
LOOKBOOK_THREADSenvironment variable or Rails configuration.
- Configurable Concurrency: Added
threadsconfiguration option.
- Visual Diff Aesthetics: Unchanged context in diff images now rendered with a light blue tint for better human readability.
- Standalone Test Harness: Integrated a dummy Rails application within
spec/dummyfor self-contained development and testing. - Full-Flow Integration Tests: Added RSpec integration tests that boot a local server and verify the entire screenshot/comparison pipeline.
- Lookbook 2.x Compatibility: Added robust support for Lookbook 2.x
scenarioswhile maintaining compatibility with 1.xexamples. - Filename Normalization: Improved screenshot naming to handle nested preview paths and avoid directory conflicts.
- Fixed Ferrum driver compatibility issue with
traffic_factorargument inwait_for_idle. - Fixed various unit tests to correctly mock configuration and scenario run state.
- better search logic, add components_folder config
-
State Management & History Tracking
- Introduced a state store with the new
Storeclass for better history management. - Implemented file history tracking, enabling more efficient change monitoring.
- Introduced a state store with the new
-
Component Refactoring
- Improved state and history handling in
LookbookVisualTester. - Updated
ScreenshotTakersignature for better integration with other system components. - Refactored
CapybaraSetupto enhance test environment flexibility. UpdatePreviewsnow inherits fromService, standardizing code structure.- Improved clipboard functionality, allowing better manipulation and copying of screenshots.
- Improved state and history handling in
-
Testing & Code Quality Enhancements
- Added new unit tests for
ScreenshotTakerandUpdatePreviews. - Refactored logging and scenario handling to improve maintainability.
- Added new unit tests for
- Extracted
n_threadsconfiguration for improved concurrency. - Introduced
save_to_clipboardfunctionality. - Extracted configuration and scenario run logic into separate classes.
- Migrated to Concurrent Ruby for better parallel execution.
- Refactored
report_generator,screenshot_taker, andsession_manager.
- Minor fixes in
report_generatorandtasks.
- Instructions added to the README.
- Initial version bump to
0.1.1.
- Initial working version.
- Set up Capybara, Railtie, and core functionalities.
- Added basic documentation and CI/CD setup.