Skip to content

Commit aeaf05b

Browse files
authored
Merge branch '2.4-develop' into Spartans_graphql_4April
2 parents 11494ed + 83b7f30 commit aeaf05b

File tree

104 files changed

+18678
-14400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+18678
-14400
lines changed

app/code/Magento/AwsS3/Driver/AwsS3.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function deleteDirectory($path): bool
257257
/**
258258
* @inheritDoc
259259
*/
260-
public function filePutContents($path, $content, $mode = null): int
260+
public function filePutContents($path, $content, $mode = null): bool|int
261261
{
262262
$path = $this->normalizeRelativePath($path, true);
263263
$config = self::CONFIG;
@@ -272,10 +272,11 @@ public function filePutContents($path, $content, $mode = null): int
272272

273273
try {
274274
$this->adapter->write($path, $content, new Config($config));
275-
return $this->adapter->fileSize($path)->fileSize();
275+
return ($this->adapter->fileSize($path)->fileSize() !== null)??true;
276+
276277
} catch (FlysystemFilesystemException | UnableToRetrieveMetadata $e) {
277278
$this->logger->error($e->getMessage());
278-
return 0;
279+
return false;
279280
}
280281
}
281282

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAwsS3SyncZeroByteFilesTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="zero byte files are synced"/>
15+
<title value="S3 - Verify zero byte files are synced"/>
16+
<description value="Verifies that zero byte files are synced to AWS S3 with error."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-8252"/>
19+
<useCaseId value="ACP2E-1608"/>
20+
<group value="remote_storage_aws_s3"/>
21+
<group value="skip_in_cloud_native_s3"/>
22+
<group value="remote_storage_disabled"/>
23+
</annotations>
24+
25+
<before>
26+
<!-- Enable AWS S3 Remote Storage & Sync -->
27+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
28+
<!-- Copy Images to Import Directory for Product Images -->
29+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProductBaseImage">
30+
<argument name="source">dev/tests/acceptance/tests/_data/empty.jpg</argument>
31+
<argument name="destination">pub/media/empty.jpg</argument>
32+
</helper>
33+
</before>
34+
35+
<after>
36+
<!-- Delete Images on Local File System -->
37+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteFileIfExists" stepKey="deleteLocalImage">
38+
<argument name="filePath">pub/media/empty.jpg</argument>
39+
</helper>
40+
<!-- Delete Images on S3 System -->
41+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteFileIfExists" stepKey="deleteS3Image">
42+
<argument name="filePath">pub/media/empty.jpg</argument>
43+
</helper>
44+
<!-- Disable AWS S3 Remote Storage -->
45+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
46+
</after>
47+
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/>
48+
<assertEquals stepKey="assertConfigTest">
49+
<expectedResult type="string">Uploading media files to remote storage.\n- empty.jpg\nEnd of upload.</expectedResult>
50+
<actualResult type="variable">$syncRemoteStorage</actualResult>
51+
</assertEquals>
52+
53+
</test>
54+
</tests>

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*
1616
* @api
1717
* @deprecated 100.2.0 in favour of UI component implementation
18+
* @see don't recommend this approach in favour of UI component implementation
1819
* @since 100.0.2
1920
*/
2021
class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Text
@@ -132,14 +133,16 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
132133
}
133134

134135
if (empty($action['id'])) {
135-
$action['id'] = 'id' .$this->random->getRandomString(10);
136+
$action['id'] = 'id' . $this->random->getRandomString(10);
136137
}
137138
$actionAttributes->setData($action);
138139
$onclick = $actionAttributes->getData('onclick');
139140
$style = $actionAttributes->getData('style');
140141
$actionAttributes->unsetData(['onclick', 'style']);
141142
$html = '<a ' . $actionAttributes->serialize() . '>' . $actionCaption . '</a>';
142143
if ($onclick) {
144+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
145+
$onclick = html_entity_decode($onclick);
143146
$html .= $this->secureHtmlRenderer->renderEventListenerAsTag('onclick', $onclick, "#{$action['id']}");
144147
}
145148
if ($style) {

app/code/Magento/Backend/Test/Mftf/ActionGroup/SecondaryGridActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
<waitForPageLoad stepKey="waitForTaxRateLoad"/>
2828

2929
<!-- delete the rule -->
30+
<waitForElementVisible selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="waitForDelete"/>
3031
<click stepKey="clickDelete" selector="{{AdminStoresMainActionsSection.deleteButton}}"/>
32+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmationModal"/>
3133
<click stepKey="clickOk" selector="{{AdminConfirmationModalSection.ok}}"/>
32-
<see stepKey="seeSuccess" selector="{{AdminMessagesSection.success}}" userInput="deleted"/>
34+
<waitForText stepKey="seeSuccess" selector="{{AdminMessagesSection.success}}" userInput="deleted"/>
3335
</actionGroup>
3436
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616
<element name="localeDisabled" type="select" selector="#general_locale_code[disabled=disabled]"/>
1717
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
1818
<element name="defaultLocale" type="checkbox" selector="#general_locale_code_inherit"/>
19+
<element name="checkIfTabExpand" type="button" selector="#general_locale-head:not(.open)"/>
20+
<element name="timeZoneDropdown" type="select" selector="//select[@id='general_locale_timezone']"/>
1921
</section>
2022
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@
4444
<element name="productAttributeName" type="button" selector="//div[@class='filter-options-title' and contains(text(),'{{var1}}')]" parameterized="true"/>
4545
<element name="productAttributeOptionValue" type="button" selector="//div[@id='narrow-by-list']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
4646
<element name="outOfStockProductCategoryPage" type="text" selector="//div[@class='stock unavailable']//span[text()='Out of stock']"/>
47+
<element name="ListedProductAttributes" type="block" selector="//div[@aria-label='{{vs_attribute}}']//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
4748
</section>
4849
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
<element name="ProductAddToCompareByName" type="text" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>
3636
<element name="ProductImageByNameAndSrc" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[contains(@src, '{{src}}')]" parameterized="true"/>
3737
<element name="ProductStockUnavailable" type="text" selector="//*[text()='Out of stock']"/>
38+
<element name="listedProductOnProductPage" type="block" selector="//div[contains(@aria-labelledBy,'{{attribute_code}}')]//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
3839
</section>
3940
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<element name="productOptionFile" type="file" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'OptionFile')]/../div[@class='control']//input[@type='file']" parameterized="true"/>
3232
<element name="productOptionSelect" type="select" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//select" parameterized="true"/>
3333
<element name="asLowAs" type="input" selector="span[class='price-wrapper '] "/>
34+
<element name="asLowAsLabel" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][1]"/>
35+
<element name="asLowAsLabelAgain" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][2]"/>
3436
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
3537
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]"/>
3638
<element name="clickForPriceLink" type="text" selector="//div[@class='price-box price-final_price']//a[contains(text(), 'Click for price')]"/>
@@ -106,7 +108,7 @@
106108
<element name="customOptionHour" type="date" selector="//div[@class='field date required']//span[text()='{{option}}']/../..//div/select[@data-calendar-role='hour']" parameterized="true"/>
107109
<element name="customOptionMinute" type="date" selector="//div[@class='field date required']//span[text()='{{option}}']/../..//div/select[@data-calendar-role='minute']" parameterized="true"/>
108110
<element name="customOptionDayPart" type="date" selector="//div[@class='field date required']//span[text()='{{option}}']/../..//div/select[@data-calendar-role='day_part']" parameterized="true"/>
109-
111+
<element name="swatchOptionDisabled" type="text" selector=".//*[@class='swatch-option color disabled']"/>
110112
<element name="addToCartEnabled" type="button" selector="#product-addtocart-button:not([disabled])"/>
111113
</section>
112114
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AddNewProductAttributeInProductPageTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<!-- Login as admin -->
2323
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2424

25+
<!-- remove the Filter From the page-->
26+
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearFilterFromProductIndex"/>
27+
2528
<!--Create Category-->
2629
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
2730

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<!-- Test XML Example -->
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminChecksIfOnlyOneQuantityConfigurationIsDisplayedForBundleProductWhileCreatingAnOrderTest">
11+
<annotations>
12+
<features value="Bundle"/>
13+
<stories value="Create Admin checks if only one Quantity Configuration is displayed for Bundle product while creating an order"/>
14+
<title value="Admin checks if only one Quantity Configuration is displayed for Bundle product while creating an order"/>
15+
<description value="create Admin checks if only one Quantity Configuration is displayed for Bundle product "/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5237"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
21+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
22+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
23+
<createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
27+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
28+
<!--Delete customer-->
29+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
31+
</after>
32+
<!-- Go to bundle product creation page -->
33+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
34+
<waitForPageLoad stepKey="waitForBundleProductCreationPage"/>
35+
<!-- Entering Bundle Product name,SKU, category, url key -->
36+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
37+
<!-- Create bundle product options -->
38+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
39+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
40+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
41+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
42+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
43+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
44+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
45+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
46+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
47+
<argument name="product" value="$$simpleProduct1$$"/>
48+
</actionGroup>
49+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
50+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
51+
<argument name="product" value="$$simpleProduct2$$"/>
52+
</actionGroup>
53+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
54+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
55+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
56+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
57+
<!--Save the product-->
58+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
59+
<!--Create new order-->
60+
<actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
61+
<argument name="customer" value="Simple_US_Customer_NY"/>
62+
</actionGroup>
63+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
64+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/>
65+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
66+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
67+
<waitForPageLoad stepKey="waitForProductLoad"/>
68+
</test>
69+
</tests>

0 commit comments

Comments
 (0)