Conversation
📝 WalkthroughWalkthroughRemoved the generic ExamplesTable→ScreenshotConfiguration converter and its concrete implementations/tests; migrated factories and consumer APIs to accept a nullable Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
vividus-plugin-mobile-app/src/test/java/org/vividus/ui/mobileapp/screenshot/MobileAppScreenshotParametersFactoryTests.java (1)
38-82: Consider adding test coverage for emptyExamplesTablerows.The tests cover the scenario where
ExamplesTable.getRowsAs()returns a single configuration and whereExamplesTableisnull, but there's no test for when the table has no rows (empty list). This edge case may be worth covering to ensure the factory handles it gracefully.
🤖 Fix all issues with AI agents
In
`@vividus-extension-selenium/src/test/java/org/vividus/ui/screenshot/AbstractScreenshotParametersFactoryTests.java`:
- Around line 96-99: In the ExamplesTable literal assigned to
screenshotConfiguration in AbstractScreenshotParametersFactoryTests.java there
is a stray "|);" fragment causing a syntax error; remove the erroneous ")"; so
the multi-line text uses proper pipes and ends with the closing triple-quote
immediately after the last row (e.g., "| 1 | 5 | 2 | 3
|" then closing """), ensuring the ExamplesTable(...) call and the
screenshotConfiguration variable compile correctly.
- Around line 84-89: The ExamplesTable literal in
AbstractScreenshotParametersFactoryTests has a stray "');" inside the
triple-quoted string causing a syntax error; edit the variable
screenshotConfiguration so the multi-line string ends with the row values only
(e.g. "| 1 | 10 | 2 | 3 |") and remove the extraneous
");" from inside the string, then leave the subsequent call to
factory.create(screenshotConfiguration, null, createEmptyIgnores()) unchanged.
In
`@vividus-plugin-applitools/src/main/java/org/vividus/visual/eyes/VisualTestingSteps.java`:
- Around line 182-188: Update the Javadoc for
performCheck(List<ApplitoolsVisualCheck>, ExamplesTable screenshotConfiguration)
to remove the WebScreenshotConfiguration-specific column names (e.g.,
webHeaderToCut, nativeHeaderToCut) and instead state that the
screenshotConfiguration is a generic ExamplesTable whose expected columns depend
on the concrete screenshot configuration implementation (or list
general/required keys if any); reference the performCheck method and the
screenshotConfiguration parameter and mention ApplitoolsVisualCheck so readers
know where the table is used.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6417 +/- ##
============================================
- Coverage 97.77% 97.75% -0.02%
- Complexity 7397 7624 +227
============================================
Files 1014 1011 -3
Lines 21405 21399 -6
Branches 1403 1404 +1
============================================
- Hits 20928 20919 -9
- Misses 361 362 +1
- Partials 116 118 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
fca7f6c to
a6a2b44
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@vividus-plugin-web-app/src/test/java/org/vividus/ui/web/screenshot/WebScreenshotParametersFactoryTests.java`:
- Line 105: Replace the inline Map.of(...) call passed to initFactory with the
existing helper createEmptyIgnores() to avoid duplication; specifically, in the
test where initFactory(Map.of(), Map.of(IgnoreStrategy.ELEMENT, Set.of(),
IgnoreStrategy.AREA, Set.of())) is called, pass createEmptyIgnores() for the
second argument (and use the appropriate first argument helper if one exists) so
the test uses the reusable createEmptyIgnores() helper instead of the inline
literal; update the call to initFactory(...) accordingly.
| factory.setShootingStrategy(SIMPLE); | ||
| factory.setScreenshotConfigurations(new PropertyMappedCollection<>(new HashMap<>())); | ||
| factory.setIgnoreStrategies(Map.of(IgnoreStrategy.ELEMENT, Set.of(), IgnoreStrategy.AREA, Set.of())); | ||
| initFactory(Map.of(), Map.of(IgnoreStrategy.ELEMENT, Set.of(), IgnoreStrategy.AREA, Set.of())); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Nit: reuse createEmptyIgnores() to avoid duplication.
This inline map literal duplicates the existing createEmptyIgnores() helper on Line 56.
♻️ Suggested diff
- initFactory(Map.of(), Map.of(IgnoreStrategy.ELEMENT, Set.of(), IgnoreStrategy.AREA, Set.of()));
+ initFactory(Map.of(), createEmptyIgnores());📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| initFactory(Map.of(), Map.of(IgnoreStrategy.ELEMENT, Set.of(), IgnoreStrategy.AREA, Set.of())); | |
| initFactory(Map.of(), createEmptyIgnores()); |
🤖 Prompt for AI Agents
In
`@vividus-plugin-web-app/src/test/java/org/vividus/ui/web/screenshot/WebScreenshotParametersFactoryTests.java`
at line 105, Replace the inline Map.of(...) call passed to initFactory with the
existing helper createEmptyIgnores() to avoid duplication; specifically, in the
test where initFactory(Map.of(), Map.of(IgnoreStrategy.ELEMENT, Set.of(),
IgnoreStrategy.AREA, Set.of())) is called, pass createEmptyIgnores() for the
second argument (and use the appropriate first argument helper if one exists) so
the test uses the reusable createEmptyIgnores() helper instead of the inline
literal; update the call to initFactory(...) accordingly.
a6a2b44 to
1855961
Compare
|
There was a problem hiding this comment.
Pull request overview
This PR refactors visual-testing steps to accept screenshot configuration as a JBehave ExamplesTable (or null for “no config”), removing now-redundant ExamplesTable→configuration converters and aligning API usage across plugins.
Changes:
- Updated screenshot-parameter factories and visual-testing steps to take
@Nullable ExamplesTableinstead ofOptional<ScreenshotConfiguration>. - Removed legacy converter classes/beans and their dedicated unit tests.
- Adjusted module dependencies to rely on
vividus-extension-seleniuminstead ofvividus-plugin-web-appwhere appropriate.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vividus-tests/src/main/resources/story/system/IPadVisualStepsTests.story | Adds an example scenario using table-driven screenshot configuration. |
| vividus-plugin-web-app/src/test/java/org/vividus/ui/web/screenshot/WebScreenshotParametersFactoryTests.java | Updates web factory tests to pass configuration via ExamplesTable and null when absent. |
| vividus-plugin-web-app/src/test/java/org/vividus/ui/web/converter/ExamplesTableToWebScreenshotParametersConverterTests.java | Removes tests for the deleted web converter. |
| vividus-plugin-web-app/src/main/resources/vividus-plugin/spring.xml | Removes the web screenshot configuration converter bean. |
| vividus-plugin-web-app/src/main/java/org/vividus/ui/web/converter/ExamplesTableToWebScreenshotConfigurationConverter.java | Deletes the now-unneeded web ExamplesTable converter. |
| vividus-plugin-visual/src/test/java/org/vividus/visual/VisualStepsTests.java | Updates visual step tests for nullable ExamplesTable screenshot config and renamed methods. |
| vividus-plugin-visual/src/main/java/org/vividus/visual/VisualSteps.java | Changes step signatures to accept ExamplesTable screenshot configuration and uses null for no config. |
| vividus-plugin-visual/build.gradle | Replaces dependency on vividus-plugin-web-app with vividus-extension-selenium. |
| vividus-plugin-mobile-app/src/test/java/org/vividus/ui/mobileapp/screenshot/MobileAppScreenshotParametersFactoryTests.java | Updates mobile factory tests to feed screenshot config via ExamplesTable. |
| vividus-plugin-mobile-app/src/test/java/org/vividus/mobileapp/converter/ExamplesTableToScreenshotConfigurationConverterTests.java | Removes tests for the deleted mobile converter. |
| vividus-plugin-mobile-app/src/main/resources/vividus-plugin/spring.xml | Removes the mobile screenshot configuration converter bean. |
| vividus-plugin-mobile-app/src/main/java/org/vividus/mobileapp/converter/ExamplesTableToScreenshotConfigurationConverter.java | Deletes the now-unneeded mobile ExamplesTable converter. |
| vividus-plugin-applitools/src/test/java/org/vividus/visual/eyes/converter/ExamplesTableToApplitoolsVisualChecksConverterTests.java | Adjusts mocks/types to the non-generic ScreenshotParametersFactory API. |
| vividus-plugin-applitools/src/test/java/org/vividus/visual/eyes/VisualTestingStepsTests.java | Updates tests to use ExamplesTable screenshot config and null for absent config. |
| vividus-plugin-applitools/src/main/java/org/vividus/visual/eyes/converter/ExamplesTableToApplitoolsVisualChecksConverter.java | Updates factory field/ctor to non-generic ScreenshotParametersFactory. |
| vividus-plugin-applitools/src/main/java/org/vividus/visual/eyes/VisualTestingSteps.java | Updates step signatures to accept ExamplesTable screenshot config and uses null for no config. |
| vividus-plugin-applitools/build.gradle | Moves vividus-plugin-web-app from main to test dependency; adds vividus-extension-selenium. |
| vividus-extension-selenium/src/test/java/org/vividus/ui/screenshot/AbstractScreenshotParametersFactoryTests.java | Updates selenium factory tests to pass configuration as ExamplesTable. |
| vividus-extension-selenium/src/test/java/org/vividus/ui/converter/AbstractExamplesTableToScreenshotConfigurationConverterTests.java | Removes tests for the deleted abstract ExamplesTable converter. |
| vividus-extension-selenium/src/main/java/org/vividus/ui/screenshot/ScreenshotParametersFactory.java | Updates factory API to accept nullable ExamplesTable and removes the generic type param. |
| vividus-extension-selenium/src/main/java/org/vividus/ui/screenshot/AbstractScreenshotParametersFactory.java | Implements ExamplesTable→configuration conversion inside the factory and adds generic-type inference helper. |
| vividus-extension-selenium/src/main/java/org/vividus/ui/converter/AbstractExamplesTableToScreenshotConfigurationConverter.java | Deletes the abstract ExamplesTable converter in favor of factory-side conversion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public Class<C> getScreenshotConfigurationClass() | ||
| { | ||
| ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass(); | ||
| //noinspection unchecked | ||
| return (Class<C>) parameterizedType.getActualTypeArguments()[0]; |
| Optional<ScreenshotParameters> create(); | ||
|
|
||
| ScreenshotParameters create(Optional<C> screenshotConfiguration, String sourceKey, | ||
| ScreenshotParameters create(@Nullable ExamplesTable screenshotConfiguration, String sourceKey, |
| List<C> screenshotConfigurations = screenshotConfiguration.getRowsAs(getScreenshotConfigurationClass()); | ||
| int rowNumber = screenshotConfigurations.size(); | ||
| isTrue(rowNumber == 1, | ||
| "Exactly one row is expected in ExamplesTable in order to convert it to screenshot configuration, " | ||
| + "but found %d row(s)", | ||
| rowNumber); |



Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation