Conversation
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/Sylius/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/2.0-docs -m "Resolve conflicts between 2.0 and 2.0-docs" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/Sylius` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/Sylius/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/2.0-docs -m "Resolve conflicts between 2.0 and 2.0-docs" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/Sylius` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/Sylius/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/2.0-docs -m "Resolve conflicts between 2.0 and 2.0-docs" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/Sylius` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
| Q | A |-----------------|----- | Branch? | 2.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | n/a | License | MIT
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
WalkthroughThis pull request updates the configuration documentation and augments many component classes by adding hook-related traits. In the documentation, the configuration file path is corrected. In both AdminBundle and ShopBundle components, the Changes
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
| Q | A |-----------------|----- | Branch? |2.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Extracted from #17635 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced query handling and expression management across various components, including cart management, product filtering, and review processing. - Improved method chaining and parameter handling in query builders for better flexibility in data retrieval. - Transitioned from specific repository implementations to more generic interfaces, enhancing flexibility. - **Chore** - Updated import statements and namespace structures for better alignment with the latest library versions, ensuring compatibility and maintainability. - Adjusted method signatures to improve type safety and clarity in the codebase. These updates contribute to a more efficient and reliable user experience throughout the shopping and order processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
| Q | A |-----------------|----- | Branch? | 1.14 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | n/a | License | MIT
| Q | A |-----------------|----- | Branch? | 2.0 <!-- see the comment below --> | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes failing CI on 2.x | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/Sylius/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/2.0 -m "Resolve conflicts between 1.14 and 2.0" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/Sylius` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
| Q | A |-----------------|----- | Branch? | 2.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | failing CI | License | MIT <!-- - Bug fixes must be submitted against the 1.13 branch - Features and deprecations must be submitted against the 1.14 branch - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html -->
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/Sylius/Bundle/ApiBundle/composer.json (1)
50-52: Conflict Declaration UpdateThe newly added
"conflict"section correctly prevents installation of"api-platform/jsonld": "^4.1.1". This ensures that incompatible versions will not be inadvertently introduced. For maintainability, consider referencing the details documented inCONFLICTS.mdso that developers have a clear cross-reference for the rationale behind this constraint.src/Sylius/Bundle/ProductBundle/spec/EventListener/SelectProductAttributeChoiceRemoveListenerSpec.php (2)
54-55: Consider adding a comment explaining the repository instantiation approachDirect instantiation of the repository represents a significant change from dependency injection. While this works fine, a brief comment explaining why this approach was chosen would help future maintainers understand the rationale behind this architectural change.
78-86: Comprehensive query builder setupThe query builder setup is thorough and well-structured. The use of
Argument::cetera()for select and from method arguments provides flexibility for future changes.However, the hard-coded parameter value on line 82 (
'%"1739bc61-9e42-4c80-8b9a-f97f0579cccb"%') could be extracted to a variable for improved readability and maintainability.- $queryBuilder->setParameter('key', '%"1739bc61-9e42-4c80-8b9a-f97f0579cccb"%')->shouldBeCalled()->willReturn($queryBuilder); + $removedChoiceKey = '1739bc61-9e42-4c80-8b9a-f97f0579cccb'; + $queryBuilder->setParameter('key', '%"' . $removedChoiceKey . '"%')->shouldBeCalled()->willReturn($queryBuilder);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (66)
.github/workflows/ci_e2e-mysql.yaml(0 hunks)CONFLICTS.md(1 hunks)behat.yml.dist(1 hunks)composer.json(1 hunks)features/hybrid/checkout/placing_order_on_multi_channel/placing_an_order_on_a_single_channel_store.feature(1 hunks)features/hybrid/checkout/placing_order_on_multi_channel/placing_an_order_on_multiple_channels_with_same_currency.feature(2 hunks)features/shop/checkout/receiving_confirmation_email_after_completing_checkout.feature(1 hunks)src/Sylius/Behat/Element/Admin/Taxon/FormElement.php(1 hunks)src/Sylius/Behat/Element/Admin/Taxon/TreeElement.php(2 hunks)src/Sylius/Behat/Element/Shop/Account/RegisterElement.php(1 hunks)src/Sylius/Behat/Element/Shop/CartWidgetElement.php(1 hunks)src/Sylius/Behat/Page/Admin/Account/LoginPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Account/RequestPasswordResetPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Account/ResetPasswordPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Administrator/ImpersonateUserPage.php(1 hunks)src/Sylius/Behat/Page/Admin/CatalogPromotion/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Crud/CreatePage.php(2 hunks)src/Sylius/Behat/Page/Admin/Crud/IndexPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Crud/UpdatePage.php(2 hunks)src/Sylius/Behat/Page/Admin/Customer/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Admin/DashboardPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Order/HistoryPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Order/ShowPage.php(2 hunks)src/Sylius/Behat/Page/Admin/Payment/PaymentRequest/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Product/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Admin/Shipment/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/AddressBook/CreatePage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/AddressBook/IndexPage.php(2 hunks)src/Sylius/Behat/Page/Shop/Account/AddressBook/UpdatePage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/ChangePasswordPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/DashboardPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/LoginPage.php(2 hunks)src/Sylius/Behat/Page/Shop/Account/Order/IndexPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/Order/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/ProfileUpdatePage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/RegisterPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/RegisterThankYouPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/RequestPasswordResetPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/ResetPasswordPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/VerificationPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Account/WellKnownPasswordChangePage.php(1 hunks)src/Sylius/Behat/Page/Shop/Checkout/AddressPage.php(2 hunks)src/Sylius/Behat/Page/Shop/Checkout/CompletePage.php(2 hunks)src/Sylius/Behat/Page/Shop/Checkout/SelectPaymentPage.php(3 hunks)src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php(3 hunks)src/Sylius/Behat/Page/Shop/HomePage.php(1 hunks)src/Sylius/Behat/Page/Shop/Order/ShowPage.php(4 hunks)src/Sylius/Behat/Page/Shop/Order/ThankYouPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Page.php(1 hunks)src/Sylius/Behat/Page/Shop/PaymentRequest/PaymentRequestNotifyPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Product/IndexPage.php(1 hunks)src/Sylius/Behat/Page/Shop/Product/ShowPage.php(1 hunks)src/Sylius/Behat/Page/Shop/ProductReview/CreatePage.php(2 hunks)src/Sylius/Behat/Page/Shop/ProductReview/IndexPage.php(1 hunks)src/Sylius/Behat/Page/SymfonyPage.php(1 hunks)src/Sylius/Behat/Page/SymfonyPageInterface.php(1 hunks)src/Sylius/Behat/Page/TestPlugin/MainPage.php(1 hunks)src/Sylius/Behat/Resources/config/services/pages.xml(1 hunks)src/Sylius/Behat/Service/DriverHelper.php(2 hunks)src/Sylius/Behat/Service/JQueryHelper.php(1 hunks)src/Sylius/Bundle/ApiBundle/composer.json(1 hunks)src/Sylius/Bundle/ApiBundle/spec/StateProvider/Shop/Product/ProductAttributeValue/CollectionProviderSpec.php(2 hunks)src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php(1 hunks)src/Sylius/Bundle/CoreBundle/spec/Doctrine/ORM/Handler/ResourceDeleteHandlerSpec.php(2 hunks)src/Sylius/Bundle/ProductBundle/spec/EventListener/SelectProductAttributeChoiceRemoveListenerSpec.php(3 hunks)src/Sylius/Bundle/ShopBundle/templates/shared/components/header/cart.html.twig(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/ci_e2e-mysql.yaml
✅ Files skipped from review due to trivial changes (30)
- features/hybrid/checkout/placing_order_on_multi_channel/placing_an_order_on_multiple_channels_with_same_currency.feature
- src/Sylius/Behat/Page/Admin/Administrator/ImpersonateUserPage.php
- src/Sylius/Behat/Page/Admin/DashboardPage.php
- src/Sylius/Behat/Page/Shop/HomePage.php
- src/Sylius/Behat/Page/Admin/Crud/IndexPage.php
- src/Sylius/Behat/Page/Admin/Account/LoginPage.php
- src/Sylius/Behat/Page/Admin/Shipment/ShowPage.php
- src/Sylius/Behat/Page/Shop/Account/RegisterThankYouPage.php
- src/Sylius/Behat/Page/Admin/Product/ShowPage.php
- src/Sylius/Behat/Page/Shop/Account/ChangePasswordPage.php
- src/Sylius/Behat/Page/Shop/Account/Order/ShowPage.php
- src/Sylius/Behat/Page/Shop/Account/ProfileUpdatePage.php
- src/Sylius/Behat/Page/Shop/Account/VerificationPage.php
- src/Sylius/Behat/Page/Admin/Customer/ShowPage.php
- src/Sylius/Behat/Page/Admin/Payment/PaymentRequest/ShowPage.php
- src/Sylius/Behat/Page/Admin/CatalogPromotion/ShowPage.php
- src/Sylius/Behat/Page/Shop/Account/WellKnownPasswordChangePage.php
- src/Sylius/Behat/Page/Shop/ProductReview/IndexPage.php
- src/Sylius/Behat/Page/Shop/Product/IndexPage.php
- features/hybrid/checkout/placing_order_on_multi_channel/placing_an_order_on_a_single_channel_store.feature
- src/Sylius/Behat/Page/Admin/Order/HistoryPage.php
- src/Sylius/Behat/Page/Shop/Account/DashboardPage.php
- src/Sylius/Behat/Page/Shop/Account/Order/IndexPage.php
- src/Sylius/Behat/Page/SymfonyPageInterface.php
- src/Sylius/Behat/Page/Admin/Account/ResetPasswordPage.php
- src/Sylius/Behat/Page/Shop/PaymentRequest/PaymentRequestNotifyPage.php
- src/Sylius/Behat/Page/Admin/Account/RequestPasswordResetPage.php
- src/Sylius/Behat/Page/Shop/Account/AddressBook/UpdatePage.php
- src/Sylius/Behat/Page/Shop/Account/ResetPasswordPage.php
- src/Sylius/Behat/Page/TestPlugin/MainPage.php
🚧 Files skipped from review as they are similar to previous changes (3)
- src/Sylius/Bundle/CoreBundle/spec/Doctrine/ORM/Handler/ResourceDeleteHandlerSpec.php
- src/Sylius/Bundle/ApiBundle/spec/StateProvider/Shop/Product/ProductAttributeValue/CollectionProviderSpec.php
- src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php
🧰 Additional context used
🧬 Code Definitions (8)
src/Sylius/Behat/Page/Shop/Account/RegisterPage.php (1)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)
src/Sylius/Behat/Page/Shop/Account/RequestPasswordResetPage.php (1)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)
src/Sylius/Behat/Page/Shop/Account/AddressBook/CreatePage.php (1)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)
src/Sylius/Behat/Page/Shop/Checkout/CompletePage.php (3)
src/Sylius/Behat/Page/Shop/Page.php (1)
Page(21-66)src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)src/Sylius/Behat/Service/DriverHelper.php (2)
DriverHelper(22-40)waitForPageToLoad(34-39)
src/Sylius/Behat/Page/Admin/Crud/UpdatePage.php (2)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)src/Sylius/Behat/Service/DriverHelper.php (2)
DriverHelper(22-40)waitForPageToLoad(34-39)
src/Sylius/Behat/Page/Shop/Account/LoginPage.php (2)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)src/Sylius/Behat/Service/DriverHelper.php (2)
DriverHelper(22-40)waitForPageToLoad(34-39)
src/Sylius/Behat/Page/Admin/Crud/CreatePage.php (2)
src/Sylius/Behat/Page/SymfonyPage.php (1)
SymfonyPage(20-28)src/Sylius/Behat/Service/DriverHelper.php (2)
DriverHelper(22-40)waitForPageToLoad(34-39)
src/Sylius/Behat/Page/Shop/Order/ThankYouPage.php (2)
src/Sylius/Behat/Page/SymfonyPage.php (2)
SymfonyPage(20-28)getElement(22-27)src/Sylius/Behat/Service/DriverHelper.php (2)
DriverHelper(22-40)waitForPageToLoad(34-39)
⏰ Context from checks skipped due to timeout of 90000ms (27)
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Panther, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / JS with Chromedriver, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.3, Symfony ^7.1 (test_cached), MySQL 8.4, Twig ^3.3
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.3, Symfony ^7.1, PostgreSQL 16.4
- GitHub Check: End-to-end tests (MySQL) / Non-JS, PHP 8.2, Symfony ^6.4 (test_cached), MySQL 8.0, Twig ^3.3
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.2, Symfony ^6.4, PostgreSQL 15.8
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.3, Symfony ^7.1, MariaDB 11.4.3, State Machine Adapter winzou_state_machine
- GitHub Check: Frontend / NodeJS 20.x
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.3, Symfony ^7.1, MariaDB 11.4.3, State Machine Adapter symfony_workflow
- GitHub Check: Frontend / NodeJS 20.x
- GitHub Check: Packages / PHP 8.3, Symfony ^7.1
- GitHub Check: Packages / PHP 8.3, Symfony ^7.1
- GitHub Check: Packages / PHP 8.2, Symfony ^6.4
- GitHub Check: Packages / PHP 8.2, Symfony ^6.4
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.3, Symfony ^7.1, PostgreSQL 16.4
- GitHub Check: End-to-end tests (PostgreSQL) / Non-JS, PHP 8.2, Symfony ^6.4, PostgreSQL 15.8
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.3, Symfony ^7.1, MariaDB 11.4.3, State Machine Adapter winzou_state_machine
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.3, Symfony ^7.1, MariaDB 11.4.3, State Machine Adapter symfony_workflow
- GitHub Check: End-to-end tests (MariaDB) / Non-JS, PHP 8.2, Symfony ^6.4, MariaDB 10.11.9, State Machine Adapter symfony_workflow
🔇 Additional comments (52)
src/Sylius/Bundle/ShopBundle/templates/shared/components/header/cart.html.twig (1)
19-19: Improved testability with cart quantity attribute.The addition of the
sylius_test_html_attributewith the 'cart-quantity' identifier enhances testability by making the cart quantity value directly accessible for automated tests, following the same pattern used elsewhere in this template ('cart-button' and 'cart-total'). This is a good practice for maintaining consistent testing attributes throughout the codebase.features/shop/checkout/receiving_confirmation_email_after_completing_checkout.feature (2)
14-14: LGTM: Updated testing tag for better browser automation control.The change from
@javascriptto@mink:chromedriverprovides more explicit control over the browser driver used for testing, which is a good practice for test stability. This change is part of standardizing the testing approach across the codebase.
22-22: LGTM: Consistent tag update across scenarios.The same tag update has been appropriately applied to this scenario as well, maintaining consistency throughout the feature file. This standardization helps ensure all scenarios use the same browser automation approach.
composer.json (1)
244-246: Root Composer Conflict Declaration CheckThe conflict block added here mirrors the one in the ApiBundle's composer file, ensuring consistency across the project. This prevents the incompatible version of
"api-platform/jsonld"from being installed. The addition is clear and aligns with the dependency resolution strategy.src/Sylius/Bundle/ProductBundle/spec/EventListener/SelectProductAttributeChoiceRemoveListenerSpec.php (3)
16-27: Well-structured updates to importsThe changes to imports reflect a shift towards using the query builder pattern instead of direct repository methods. The use of
Doctrine\Persistence\Event\LifecycleEventArgsinstead of the ORM-specific version is particularly good as it reduces coupling to a specific ORM implementation.
45-47: Good addition of required dependenciesThe addition of QueryBuilder, Connection, and Query parameters correctly supports the new implementation approach.
71-71: Good addition of connection retrievalThe addition of the connection retrieval from the entity manager properly supports the new query-based approach.
src/Sylius/Behat/Page/Shop/Product/ShowPage.php (1)
388-388: Improved wait time to enhance test stability.Increasing the wait time from 1 to 2 seconds when waiting for the summary page to be open helps address potential race conditions, especially in complex JavaScript interactions. This change should reduce test flakiness.
src/Sylius/Behat/Element/Admin/Taxon/FormElement.php (1)
90-91: Improved stability by ensuring page is fully loaded before retrieving values.Adding
DriverHelper::waitForPageToLoad()ensures that the page has completed loading before retrieving translation field values, reducing the possibility of flaky tests that might occur when attempting to access elements before they're fully rendered.src/Sylius/Behat/Page/Shop/Checkout/AddressPage.php (2)
21-21: Added necessary import for DriverHelper.This import enables the use of the waitForPageToLoad method to improve page loading handling.
208-208: Enhanced checkout flow stability with page load waiting.Adding
DriverHelper::waitForPageToLoad()after clicking the next step button ensures that the application waits for the next page to fully load before proceeding, preventing race conditions in the checkout flow tests.src/Sylius/Behat/Element/Shop/Account/RegisterElement.php (2)
19-19: Added necessary import for DriverHelper.This import supports the new page load waiting functionality added to the register method.
26-27: Improved registration flow stability with page load waiting.Adding
DriverHelper::waitForPageToLoad()after the register button click ensures that the code waits for the page to fully load after registration submission, preventing potential test failures that could occur if subsequent operations execute before the page transition completes.src/Sylius/Behat/Page/Shop/Order/ThankYouPage.php (2)
17-17: Added helpful import for DriverHelper.The import of
DriverHelperclass provides access to utility methods for handling driver behavior, especially waiting for page loads. This addition supports the subsequent changes in the method implementation.
24-25: Improved reliability by adding wait for page load.Adding
DriverHelper::waitForPageToLoad()after the click action is an important enhancement that prevents race conditions and ensures the page is fully loaded before proceeding with subsequent actions. This is especially important for JavaScript-driven pages where elements might not be immediately available after navigation.src/Sylius/Behat/Page/Shop/Account/AddressBook/CreatePage.php (1)
18-18: Updated import to use Sylius's own SymfonyPage implementation.The import has been changed from
FriendsOfBehat\PageObjectExtension\Page\SymfonyPagetoSylius\Behat\Page\SymfonyPage. This is a positive change as it leverages Sylius's own implementation which, based on the provided context, includes automatic page load waiting in thegetElementmethod.This change is part of a broader refactoring to improve test reliability. The custom
SymfonyPageimplementation automatically callsDriverHelper::waitForPageToLoad()when getting elements, which helps prevent race conditions throughout the test suite.behat.yml.dist (1)
53-68: Enhanced Chrome browser configuration for headless testing.The addition of the
optionssection with detailedbrowser_argumentssignificantly improves the headless Chrome configuration for testing. These arguments:
- Set window size for consistent viewport
- Enable headless mode
- Disable various features that can interfere with automated testing (sandbox, GPU, infobars, etc.)
- Prevent browser popups and background activities
This configuration will lead to more stable and predictable test runs across different environments.
src/Sylius/Behat/Page/Shop/ProductReview/CreatePage.php (2)
17-17: Added important import for DriverHelper.The import of
DriverHelperclass provides access to utility methods for handling driver behavior, specifically waiting for page loads. This addition supports the subsequent changes in the method implementation.
55-56: Improved test reliability by adding wait for page load after form submission.Adding
DriverHelper::waitForPageToLoad()after the form submission is an excellent enhancement that prevents race conditions and ensures the page is fully loaded before proceeding. This is particularly important after form submissions, which typically trigger page reloads or redirects.This change improves the test reliability by ensuring that any subsequent actions or assertions only happen after the page has completely loaded following the review submission.
src/Sylius/Behat/Element/Admin/Taxon/TreeElement.php (1)
17-17: Good improvement for test reliability!Adding the
DriverHelper::waitForPageToLoad()call before counting taxons ensures the page is fully loaded prior to accessing DOM elements. This is an important fix that will reduce flaky tests by preventing premature element counting before the page has completely rendered.Also applies to: 35-36
src/Sylius/Behat/Page/SymfonyPage.php (1)
1-29: Excellent architectural improvement for test reliability!Creating this custom
SymfonyPageclass that extends the base implementation is a strong design choice. By overriding thegetElementmethod to ensure pages are fully loaded before element retrieval, you've implemented a consistent approach that automatically benefits all page objects without requiring changes to individual implementations.This will significantly reduce flaky tests across the entire test suite by preventing premature element access.
src/Sylius/Behat/Service/JQueryHelper.php (1)
23-23: Improved approach to detecting asynchronous actions!This change shifts from jQuery-specific detection to a more robust DOM-based approach by:
- Looking for the absence of
[data-live-loading=true]elements rather than relying on jQuery's ajax state- Adding a proper check for JavaScript-enabled drivers before attempting to wait
- Using document.readyState in combination with the loading attribute check
This makes the tests more resilient to different ajax implementation methods and provides a standardized way to detect loading states across the application.
Also applies to: 28-30
src/Sylius/Behat/Resources/config/services/pages.xml (1)
32-32: Necessary service configuration update for the enhanced SymfonyPageThis change properly updates the service definition to use Sylius' custom
SymfonyPageimplementation instead of the external FriendsOfBehat version. This ensures all page services will benefit from the enhanced wait-for-page-load functionality introduced in the custom implementation.src/Sylius/Behat/Page/Shop/Account/RequestPasswordResetPage.php (1)
17-17: Clean namespace transition for SymfonyPage.The import statement is updated to use the internal Sylius implementation instead of the external library. This change is beneficial as it reduces external dependencies and provides enhanced functionality through the new
SymfonyPageimplementation, which now includes page loading verification before element retrieval.src/Sylius/Behat/Page/Shop/Page.php (1)
18-19: Updated imports align with enhanced page object model.Both changes improve the test framework:
- Using the internal
Sylius\Behat\Page\SymfonyPageimplementation reduces external dependencies- Adding
DriverHelperimport supports the enhanced functionality in the page object modelThese changes allow the Page class to benefit from the waitForPageToLoad functionality that's now built into the SymfonyPage parent class.
src/Sylius/Behat/Service/DriverHelper.php (1)
19-19: Excellent addition of page loading helper function.This new
waitForPageToLoadmethod significantly improves test reliability by ensuring elements are fully loaded before interaction. The implementation is well-designed:
- It only applies the wait to JavaScript-capable drivers (Selenium, ChromeDriver, PantherDriver)
- The wait condition is comprehensive, checking both document readiness and absence of loading indicators
- The method will now be used by the SymfonyPage class to make all element interactions more robust
This is a valuable enhancement that will help prevent flaky tests caused by timing issues.
Also applies to: 34-39
src/Sylius/Behat/Page/Shop/Account/RegisterPage.php (1)
17-17: SymfonyPage namespace transition improves page object model.The import statement update is part of a consistent pattern across the codebase, replacing the external
FriendsOfBehat\PageObjectExtension\Page\SymfonyPagewith the internalSylius\Behat\Page\SymfonyPageimplementation. This change leverages the enhanced functionality of the internal implementation, particularly the automatic page loading verification before element retrieval.src/Sylius/Behat/Page/Admin/Crud/CreatePage.php (2)
21-21: Updated import path for SymfonyPage.The import statement has been updated to use the local
Sylius\Behat\Page\SymfonyPageinstead of the externalFriendsOfBehat\PageObjectExtension\Page\SymfonyPage. This change aligns with the custom implementation that includes thewaitForPageToLoadfunctionality in thegetElementmethod.
43-43: Added page load wait after button click for improved test reliability.Adding
DriverHelper::waitForPageToLoad($this->getSession());after the create button click ensures that the page is fully loaded before proceeding with subsequent operations. This enhances test stability by preventing race conditions where tests might try to interact with elements before they're fully rendered.src/Sylius/Behat/Page/Shop/Checkout/SelectPaymentPage.php (3)
17-17: Updated import path for SymfonyPage.The import statement has been updated to use the local
Sylius\Behat\Page\SymfonyPageclass which includes additional functionality for handling page loading states.
30-30: Added DOM readiness check before interacting with payment methods.Adding a wait condition to ensure the document body is available before attempting to interact with payment method elements. This improves test reliability, especially in JavaScript-enabled test environments where DOM elements might not be immediately available.
63-63: Added page load wait after navigation to enhance test stability.Adding
DriverHelper::waitForPageToLoad($this->getSession());after proceeding to the next checkout step ensures that the page is fully loaded before continuing. This prevents potential race conditions where tests might fail because they're interacting with elements on the next page before it's fully rendered.src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php (3)
17-17: Updated import path for SymfonyPage.The import statement has been updated to use the local
Sylius\Behat\Page\SymfonyPageclass which includes additional functionality for handling page loading states.
30-30: Added DOM readiness check before interacting with shipping methods.Adding a wait condition to ensure the document body is available before attempting to interact with shipping method elements. This improves test reliability, especially in JavaScript-enabled test environments where DOM elements might not be immediately available.
79-79: Added page load wait after navigation to enhance test stability.Adding
DriverHelper::waitForPageToLoad($this->getSession());after proceeding to the next checkout step ensures that the page is fully loaded before continuing. This prevents potential race conditions where tests might fail because they're interacting with elements on the next page before it's fully rendered.src/Sylius/Behat/Page/Admin/Crud/UpdatePage.php (2)
21-21: Updated import path for SymfonyPage.The import statement has been updated to use the local
Sylius\Behat\Page\SymfonyPageinstead of the externalFriendsOfBehat\PageObjectExtension\Page\SymfonyPage. This change aligns with the custom implementation that includes thewaitForPageToLoadfunctionality in thegetElementmethod.
43-43: Added page load wait after button click for improved test reliability.Adding
DriverHelper::waitForPageToLoad($this->getSession());after clicking the update changes button ensures that the page is fully loaded before proceeding with subsequent operations. This enhances test stability by preventing race conditions where tests might try to interact with elements before they're fully rendered.src/Sylius/Behat/Page/Shop/Checkout/CompletePage.php (2)
18-18: Updated import to use Sylius namespace.The import statement for
SymfonyPagehas been changed fromFriendsOfBehat\PageObjectExtension\Page\SymfonyPagetoSylius\Behat\Page\SymfonyPage. This change aligns with a broader effort to transition the codebase to Sylius-namespace components.
185-186: Added page load waiting after confirm button press.Adding
DriverHelper::waitForPageToLoadafter the confirm button is pressed improves test reliability by ensuring the page has fully loaded before proceeding with any subsequent operations. This helps prevent race conditions where tests might try to interact with elements before they're available in the DOM.src/Sylius/Behat/Page/Shop/Account/LoginPage.php (2)
16-17: Updated imports to use Sylius namespace and added DriverHelper.The import statement for
SymfonyPagehas been changed to use the Sylius namespace, and an import forDriverHelperhas been added. This is part of the broader effort to transition away from direct dependencies on external libraries.
34-35: Added page load waiting after login button click.Adding
DriverHelper::waitForPageToLoadafter clicking the login button ensures the page has completely loaded before proceeding with subsequent actions. This enhancement makes tests more robust by preventing timing-related issues, especially in JavaScript-enabled browser tests.src/Sylius/Behat/Page/Shop/Account/AddressBook/IndexPage.php (2)
16-17: Updated imports to use Sylius namespace and added DriverHelper.The import statement for
SymfonyPagehas been updated to use the Sylius namespace, and an import forDriverHelperhas been added. This change is consistent with other files in this PR that are transitioning to Sylius-namespace components.
61-62: Added page load waiting after delete button press.Adding
DriverHelper::waitForPageToLoadafter pressing the delete button ensures the page is fully loaded before executing any subsequent actions. This improves test reliability by avoiding potential race conditions where tests might proceed before the deletion is complete and the page has updated.src/Sylius/Behat/Page/Admin/Order/ShowPage.php (2)
19-21: Updated imports to use Sylius namespace and added DriverHelper.The import statements have been updated to use the Sylius namespace for
SymfonyPageand to add theDriverHelperservice. This change is consistent with the other files in this PR, indicating a systematic effort to transition to Sylius-namespace components.
344-345: Added page load waiting before retrieving currency information.Adding
DriverHelper::waitForPageToLoadat the beginning of thegetOrderCurrencymethod ensures the page is fully loaded before attempting to retrieve the currency element's text. This enhancement improves test reliability by preventing potential timing issues where the method might try to access the element before it's available in the DOM.src/Sylius/Behat/Page/Shop/Order/ShowPage.php (4)
16-18: Good addition of DriverHelper for stable testsYou've updated the imports to use the internal
Sylius\Behat\Page\SymfonyPageinstead of the external one, and added theDriverHelperwhich will improve test stability.
32-37: Enhanced reliability in pay() method with page load waitingAdding the wait for page load after clicking the pay link will help prevent flaky tests by ensuring the page is fully loaded before proceeding to the next steps.
52-58: Improved test stability in choosePaymentMethod()Adding the wait for page load at the beginning of the method ensures that the payment method elements are fully loaded and interactive before attempting to select them.
72-85: Enhanced getChosenPaymentMethod() reliabilityThe addition of the wait for page load ensures that all payment method elements are fully rendered before attempting to find and check their state.
src/Sylius/Behat/Element/Shop/CartWidgetElement.php (3)
16-18: Good addition of DriverHelper importThe added import for DriverHelper aligns with other changes in the codebase, even though it's not directly used in this file yet.
21-31: Improved robustness of cart quantity retrievalThe updated implementation is more resilient:
- It properly handles cases when the cart quantity element doesn't exist
- It directly uses the
data-test-cart-quantityattribute instead of parsing text- It has proper type checking with the
is_numericfunctionThis change will make the tests more stable and less prone to failure when the UI changes.
33-38: Updated element definition to match implementationThe element definition has been updated from
cart_buttontocart_quantityto align with the new implementation that focuses on the quantity element directly.
| # CONFLICTS | ||
|
|
||
| This document explains why certain conflicts were added to `composer.json` and | ||
| references related issues. | ||
|
|
||
| - `api-platform/jsonld: ^4.1.1` | ||
|
|
||
| API Platform introduced changes in version 4.1.1 that modify API responses, potentially breaking compatibility with our current implementation. | ||
| To ensure stable behavior, we have added this conflict until we can verify and adapt to the changes. |
There was a problem hiding this comment.
🛠️ Refactor suggestion
New Conflict Documentation Review
The CONFLICTS.md file now clearly documents the conflict with "api-platform/jsonld": "^4.1.1", explaining that changes introduced in version 4.1.1 may break compatibility with the current implementation. This added documentation improves transparency and aids in the troubleshooting of dependency issues. For further clarity, consider adding a reference (e.g., issue number or PR link) if available.
This PR has been generated automatically. For more details see [refactor.yaml](/Sylius/Sylius/blob/1.12/.github/workflows/refactor.yaml).
This PR has been generated automatically.
For more details see upmerge_pr.yaml.
Remember! The upmerge should always be merged with using
Merge pull requestbutton.In case of conflicts, please resolve them manually with usign the following commands:
If you use other name for the upstream remote, please replace
upstreamwith the name of your remote pointing to theSylius/Syliusrepository.Once the conflicts are resolved, please run
git merge --continueand push the changes to this PR.Summary by CodeRabbit
Documentation
Refactor
Style
New Features
DriverHelpermethod to wait for page loads, enhancing reliability in page interactions.getElementmethod inSymfonyPageto wait for page loads before retrieving elements.Chores
SymfonyPage.composer.jsonfiles for compatibility management.