Skip to content

Commit bd8b19b

Browse files
committed
ACQE-8277: Use empty file as a Custom Option of File type
- Fixed review comments
1 parent 6acc628 commit bd8b19b

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
* All Rights Reserved.
66
*/
77
-->
8+
89
<actionGroups
910
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1011
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="VerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" extends="AddToCartFromStorefrontProductPageActionGroup">
12+
<actionGroup name="StorefrontVerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" extends="AddToCartFromStorefrontProductPageActionGroup">
1213
<arguments>
1314
<argument name="productName" type="string"/>
1415
</arguments>
1516
<remove keyForRemoval="waitForSuccessMessage"/>
1617
<remove keyForRemoval="seeAddToCartSuccessMessage"/>
17-
<waitForText selector="{{StorefrontProductInfoMainSection.customEmptyFileValidationMessage}}" userInput="{{EmptyFilesAndValidationMessage.fileValidationMessage}}" stepKey="verify"/>
18+
<waitForText selector="{{StorefrontProductInfoMainSection.customEmptyFileValidationMessage}}" userInput="{{EmptyFileValidationMessage.fileValidationMessage}}" stepKey="verifyEmptyFileValidationMessage"/>
1819
</actionGroup>
1920
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,9 +1604,4 @@
16041604
<requiredEntity type="product_option">ProductOptionField20</requiredEntity>
16051605
<requiredEntity type="product_option">ProductOptionField21</requiredEntity>
16061606
</entity>
1607-
<entity name="EmptyFilesAndValidationMessage">
1608-
<data key="file1">emptyTxtFile.txt</data>
1609-
<data key="file2">emptyPngFile.png</data>
1610-
<data key="fileValidationMessage">The file is empty. Select another file and try again.</data>
1611-
</entity>
16121607
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,5 +456,14 @@
456456
<data key="price">9.99</data>
457457
<data key="price_type">fixed</data>
458458
<data key="file_extension">txt</data>
459+
<data key="image_size_x">500</data>
460+
<data key="image_size_y">500</data>
461+
</entity>
462+
<entity name="EmptyFiles">
463+
<data key="file1">emptyTxtFile.txt</data>
464+
<data key="file2">emptyPngFile.png</data>
465+
</entity>
466+
<entity name="EmptyFileValidationMessage">
467+
<data key="fileValidationMessage">The file is empty. Select another file and try again.</data>
459468
</entity>
460469
</entities>

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
* All Rights Reserved.
66
*/
77
-->
8+
89
<tests
910
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1011
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1112
<test name="StoreFrontUseEmptyFileAsACustomOptionOfFileTypeTest">
1213
<annotations>
14+
<features value="Catalog"/>
1315
<stories value="Empty file as a custom option for the file type"/>
1416
<title value="Product custom options"/>
1517
<description value="Verify the validation of an empty file as a custom option for the file type."/>
@@ -20,14 +22,14 @@
2022
<before>
2123
<!-- Pre-condition 1:Create Simple Product -->
2224
<createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/>
23-
<!-- Login As Admin -->
24-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2525
</before>
2626
<after>
2727
<!-- Delete product, Logout from Admin -->
2828
<deleteData createDataKey="initialSimpleProduct" stepKey="deleteSimpleProduct"/>
2929
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3030
</after>
31+
<!-- Login As Admin -->
32+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
3133
<!-- Step1: Open a product page in Admin and Open Customizable options tab.-->
3234
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductForEdit">
3335
<argument name="productId" value="$initialSimpleProduct.id$"/>
@@ -46,10 +48,10 @@
4648
</actionGroup>
4749
<!-- Step4: Upload an empty file -->
4850
<actionGroup ref="StorefrontAttachOptionFileActionGroup" stepKey="selectAndAttachFile">
49-
<argument name="file" value="EmptyFilesAndValidationMessage.file1" />
51+
<argument name="file" value="EmptyFiles.file1" />
5052
</actionGroup>
51-
<!--Step4: Verify An error should be displayed when adding to cart -->
52-
<actionGroup ref="VerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" stepKey="addProductToCart">
53+
<!--Step4 Assertion: Verify An error should be displayed when adding to cart -->
54+
<actionGroup ref="StorefrontVerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" stepKey="addProductToCart">
5355
<argument name="productName" value="$initialSimpleProduct.name$"/>
5456
</actionGroup>
5557
<!-- Open product in admin and delete existing custom option-->
@@ -73,10 +75,10 @@
7375
</actionGroup>
7476
<!--Step7: Upload an empty image -->
7577
<actionGroup ref="StorefrontAttachOptionFileActionGroup" stepKey="selectAndAttachTheFile">
76-
<argument name="file" value="EmptyFilesAndValidationMessage.file2" />
78+
<argument name="file" value="EmptyFiles.file2" />
7779
</actionGroup>
78-
<!-- Step7: Verify An error should be displayed when adding to cart -->
79-
<actionGroup ref="VerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" stepKey="addTheProductToCart">
80+
<!-- Step7 Assertion: Verify An error should be displayed when adding to cart -->
81+
<actionGroup ref="StorefrontVerifyErrorMessageDisplayedWhileAddingProductWithEmptyFileToCartActionGroup" stepKey="addTheProductToCart">
8082
<argument name="productName" value="$initialSimpleProduct.name$"/>
8183
</actionGroup>
8284
</test>

0 commit comments

Comments
 (0)