forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.3-tests-pr' of github.com:magento-pangolin/magento2ce…
… into MC-6484
- Loading branch information
Showing
145 changed files
with
10,036 additions
and
746 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/code/Magento/AdminNotification/Test/Mftf/Section/AdminSystemMessagesSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminSystemMessagesSection"> | ||
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/> | ||
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminCreateAndEditBundleProductSettingsTest"> | ||
<annotations> | ||
<features value="Bundle"/> | ||
<stories value="Create/Edit bundle product in Admin"/> | ||
<title value="Admin should be able to set/edit other product information when creating/editing a bundle product"/> | ||
<description value="Admin should be able to set/edit other product information when creating/editing a bundle product"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-224"/> | ||
<group value="Catalog"/> | ||
</annotations> | ||
<before> | ||
<!-- Create a Website --> | ||
<createData entity="customWebsite" stepKey="createWebsite"/> | ||
|
||
<!-- Create a simple product for a bundle option --> | ||
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> | ||
|
||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<!-- Delete the simple product --> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Create new bundle product --> | ||
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct"> | ||
<argument name="productType" value="bundle"/> | ||
</actionGroup> | ||
|
||
<!-- Fill all main fields --> | ||
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/> | ||
|
||
<!-- Add the bundle option to the product --> | ||
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption"> | ||
<argument name="x" value="0"/> | ||
<argument name="n" value="1"/> | ||
<argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/> | ||
<argument name="prodTwoSku" value=""/> | ||
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/> | ||
<argument name="inputType" value="{{RadioButtonsOption.type}}"/> | ||
</actionGroup> | ||
|
||
<!-- Set product in created Website --> | ||
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites"> | ||
<argument name="website" value="$createWebsite.website[name]$"/> | ||
</actionGroup> | ||
|
||
<!-- Set Design settings for the product --> | ||
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings"> | ||
<argument name="designSettings" value="simpleLumaDesignThreeColumns"/> | ||
</actionGroup> | ||
|
||
<!-- Set Gift Options settings for the product --> | ||
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings"> | ||
<argument name="status" value="1"/> | ||
</actionGroup> | ||
|
||
<!-- Save product form --> | ||
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> | ||
|
||
<!-- Open product page --> | ||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> | ||
<argument name="productUrl" value="{{BundleProduct.name}}"/> | ||
</actionGroup> | ||
|
||
<!-- Assert product Design settings "layout 3 columns" --> | ||
<seeElement selector="{{StorefrontProductPageDesignSection.layoutThreeColumns}}" stepKey="seeDesignChanges"/> | ||
|
||
<!-- Assert Gift Option product settings is present --> | ||
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="productName" value="{{BundleProduct.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> | ||
<actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/> | ||
|
||
<!-- Open created product --> | ||
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> | ||
<argument name="product" value="BundleProduct"/> | ||
</actionGroup> | ||
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> | ||
<argument name="product" value="BundleProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Assert product in assigned to Website --> | ||
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> | ||
<argument name="website" value="$createWebsite.website[name]$"/> | ||
</actionGroup> | ||
|
||
<!-- Edit product in Websites --> | ||
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="uncheckProductInWebsites"> | ||
<argument name="website" value="$createWebsite.website[name]$"/> | ||
</actionGroup> | ||
|
||
<!-- Edit product Search Engine Optimization settings --> | ||
<actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings"> | ||
<argument name="productName" value="ApiBundleProduct.name"/> | ||
</actionGroup> | ||
|
||
<!-- Edit Design settings for the product --> | ||
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings"/> | ||
|
||
<!-- Edit Gift Option product settings --> | ||
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> | ||
|
||
<!-- Save product form --> | ||
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> | ||
|
||
<!-- Verify Url Key after changing --> | ||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> | ||
<argument name="productUrl" value="{{ApiBundleProduct.name}}"/> | ||
</actionGroup> | ||
|
||
<!-- Assert product design settings "Layout empty" --> | ||
<seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeNewDesignChanges"/> | ||
|
||
<!-- Assert Gift Option product settings --> | ||
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> | ||
<dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> | ||
|
||
<!-- Delete created bundle product --> | ||
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> | ||
<argument name="product" value="BundleProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Delete created Website --> | ||
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> | ||
<argument name="websiteName" value="$createWebsite.website[name]$"/> | ||
</actionGroup> | ||
</test> | ||
</tests> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/code/Magento/Catalog/Model/Category/StoreCategories.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Model\Category; | ||
|
||
use Magento\Catalog\Api\CategoryRepositoryInterface; | ||
use Magento\Catalog\Model\Category; | ||
use Magento\Store\Api\GroupRepositoryInterface; | ||
|
||
/** | ||
* Fetcher for associated with store group categories. | ||
*/ | ||
class StoreCategories | ||
{ | ||
/** | ||
* @var CategoryRepositoryInterface | ||
*/ | ||
private $categoryRepository; | ||
|
||
/** | ||
* @var GroupRepositoryInterface | ||
*/ | ||
private $groupRepository; | ||
|
||
/** | ||
* @param CategoryRepositoryInterface $categoryRepository | ||
* @param GroupRepositoryInterface $groupRepository | ||
*/ | ||
public function __construct( | ||
CategoryRepositoryInterface $categoryRepository, | ||
GroupRepositoryInterface $groupRepository | ||
) { | ||
$this->categoryRepository = $categoryRepository; | ||
$this->groupRepository = $groupRepository; | ||
} | ||
|
||
/** | ||
* Get all category ids for store. | ||
* | ||
* @param int|null $storeGroupId | ||
* @return int[] | ||
* @throws \Magento\Framework\Exception\NoSuchEntityException | ||
*/ | ||
public function getCategoryIds(?int $storeGroupId = null): array | ||
{ | ||
$rootCategoryId = $storeGroupId | ||
? $this->groupRepository->get($storeGroupId)->getRootCategoryId() | ||
: Category::TREE_ROOT_ID; | ||
/** @var Category $rootCategory */ | ||
$rootCategory = $this->categoryRepository->get($rootCategoryId); | ||
$categoriesIds = array_map( | ||
function ($value) { | ||
return (int) $value; | ||
}, | ||
(array) $rootCategory->getAllChildren(true) | ||
); | ||
|
||
return $categoriesIds; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductInWebsiteActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminAssignProductInWebsiteActionGroup"> | ||
<arguments> | ||
<argument name="website" type="string"/> | ||
</arguments> | ||
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsitesSection"/> | ||
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="expandSection"/> | ||
<waitForPageLoad stepKey="waitForPageOpened"/> | ||
<checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> | ||
</actionGroup> | ||
</actionGroups> |
22 changes: 22 additions & 0 deletions
22
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeProductSEOSettingsActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminChangeProductSEOSettingsActionGroup"> | ||
<arguments> | ||
<argument name="productName" defaultValue="_defaultProduct.name"/> | ||
</arguments> | ||
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickSearchEngineOptimizationTab"/> | ||
<waitForPageLoad stepKey="waitForTabOpen"/> | ||
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{productName}}" stepKey="setUrlKeyInput"/> | ||
<fillField selector="{{AdminProductSEOSection.metaTitleInput}}" userInput="{{productName}}" stepKey="setMetaTitleInput"/> | ||
<fillField selector="{{AdminProductSEOSection.metaKeywordsInput}}" userInput="{{productName}}" stepKey="setMetaKeywordsInput"/> | ||
<fillField selector="{{AdminProductSEOSection.metaDescriptionInput}}" userInput="{{productName}}" stepKey="setMetaDescriptionInput"/> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDesignSettingsActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSetProductDesignSettingsActionGroup"> | ||
<arguments> | ||
<argument name="designSettings" defaultValue="simpleBlankDesignTwoColumnsLeft"/> | ||
</arguments> | ||
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/> | ||
<waitForPageLoad stepKey="waitForTabOpen"/> | ||
<selectOption selector="{{ProductDesignSection.LayoutDropdown}}" userInput="{{designSettings.page_layout}}" stepKey="setLayout"/> | ||
<selectOption selector="{{ProductDesignSection.productOptionsContainer}}" userInput="{{designSettings.options_container}}" stepKey="setDisplayProductOptions"/> | ||
</actionGroup> | ||
</actionGroups> |
Oops, something went wrong.