Skip to content

Commit 4c67f22

Browse files
ENGCOM-6377: Tests for: #25585, #25248, #25058. #25853
2 parents e0c180a + 83e3957 commit 4c67f22

File tree

7 files changed

+204
-1
lines changed

7 files changed

+204
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
<arguments>
3232
<argument name="productVar"/>
3333
</arguments>
34-
34+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}"
35+
stepKey="seeAddToCompareLink"/>
3536
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
3637
<waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/>
3738
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/>
@@ -92,4 +93,19 @@
9293
<waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/>
9394
<waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/>
9495
</actionGroup>
96+
97+
<!-- Check Product is present in the comparison list -->
98+
<actionGroup name="SeeProductInComparisonListActionGroup">
99+
<annotations>
100+
<description>Validate that the Product is present in the comparison list</description>
101+
</annotations>
102+
<arguments>
103+
<argument name="productVar"/>
104+
</arguments>
105+
106+
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
107+
<waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/>
108+
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}"
109+
stepKey="seeProductInCompareList"/>
110+
</actionGroup>
95111
</actionGroups>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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="ProductAttributeWithoutValueInCompareListTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Product attribute without value in compare list test"/>
15+
<description
16+
value="The product attribute that has no value should output 'N/A' on the product comparison page."/>
17+
<severity value="MINOR"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
<createData entity="textProductAttribute" stepKey="createProductAttribute"/>
23+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
24+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/"
25+
stepKey="onAttributeSetEdit"/>
26+
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
27+
<argument name="group" value="Product Details"/>
28+
<argument name="attribute" value="$$createProductAttribute.attribute_code$$"/>
29+
</actionGroup>
30+
<actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/>
31+
<createData entity="_defaultCategory" stepKey="createCategory"/>
32+
<createData entity="_defaultProduct" stepKey="createProductDefault">
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
<createData entity="SimpleProductWithCustomAttributeSet" stepKey="createProductCustom">
36+
<requiredEntity createDataKey="createCategory"/>
37+
<requiredEntity createDataKey="createAttributeSet"/>
38+
</createData>
39+
</before>
40+
<after>
41+
<deleteData createDataKey="createProductDefault" stepKey="deleteProductDefault"/>
42+
<deleteData createDataKey="createProductCustom" stepKey="deleteProductCustom"/>
43+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
44+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
45+
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
46+
<actionGroup ref="logout" stepKey="logout"/>
47+
</after>
48+
<!--Open product page-->
49+
<amOnPage url="{{StorefrontProductPage.url($$createProductDefault.name$$)}}" stepKey="goToProductDefaultPage"/>
50+
<waitForPageLoad stepKey="waitForProductPage"/>
51+
<!--Click on 'Add to Compare' link-->
52+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompare">
53+
<argument name="productVar" value="$$createProductDefault$$"/>
54+
</actionGroup>
55+
<!--See product in the comparison list-->
56+
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductDefaultInComparisonListActionGroup">
57+
<argument name="productVar" value="$$createProductDefault$$"/>
58+
</actionGroup>
59+
<!--Open product with custom attribute page-->
60+
<amOnPage url="{{StorefrontProductPage.url($$createProductCustom.name$$)}}" stepKey="goToProductCustomPage"/>
61+
<waitForPageLoad stepKey="waitForProductCustomPage"/>
62+
<!--Click on 'Add to Compare' link-->
63+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickOnAddToCompareCustom">
64+
<argument name="productVar" value="$$createProductCustom$$"/>
65+
</actionGroup>
66+
<!--See product with custom attribute in the comparison list-->
67+
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductCustomInComparisonListActionGroup">
68+
<argument name="productVar" value="$$createProductCustom$$"/>
69+
</actionGroup>
70+
<!--See attribute default value in the comparison list-->
71+
<see userInput="$createProductAttribute.defaultValue$"
72+
selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductCustom.name$)}}"
73+
stepKey="assertAttributeValueForProductCustom"/>
74+
<!--See N/A if attribute has no value in the comparison list-->
75+
<see userInput="N/A"
76+
selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName(ProductAttributeFrontendLabel.label, $createProductDefault.name$)}}"
77+
stepKey="assertNAForProductDefault"/>
78+
</test>
79+
</tests>

app/code/Magento/ImportExport/Test/Mftf/Section/AdminImportMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<element name="messageError" type="text" selector=".messages div.message-error"/>
1818
<element name="validationStrategy" type="select" selector="#basic_behaviorvalidation_strategy"/>
1919
<element name="allowedErrorsCount" type="input" selector="#basic_behavior_allowed_error_count"/>
20+
<element name="importImagesFileDirNote" type="input" selector="#import_images_file_dir-note"/>
2021
</section>
2122
</sections>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminImagesFileDirectoryCorrectExplanationTest">
12+
<annotations>
13+
<features value="Import/Export"/>
14+
<stories value="Import CSV file"/>
15+
<title value="Images file directory correct explanation test"/>
16+
<description value="Check correct explanation for the 'Images File Directory' option."/>
17+
<severity value="MINOR"/>
18+
<group value="importExport"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
25+
</after>
26+
<amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/>
27+
<waitForPageLoad stepKey="adminImportMainSectionLoad"/>
28+
<selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/>
29+
<waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/>
30+
31+
<see selector="{{AdminImportMainSection.importImagesFileDirNote}}" userInput='For Type "Local Server" use relative path to &lt;Magento root directory&gt;/var/import/images, e.g. ' stepKey="seeCorrectExplanation"/>
32+
</test>
33+
</tests>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="AdminNewsletterSubscriberPage" url="newsletter/subscriber/index/" area="admin" module="Magento_Newsletter">
11+
<section name="AdminNewsletterSubscriberGridSection"/>
12+
</page>
13+
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminNewsletterSubscriberGridSection">
11+
<element name="email" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='email']" parameterized="true"/>
12+
<element name="type" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='type']" parameterized="true"/>
13+
<element name="firstName" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='firstname']" parameterized="true"/>
14+
<element name="lastName" type="text" selector="//table[contains(@class, 'data-grid')]/tbody/tr[{{row}}][@data-role='row']/td[@data-column='lastname']" parameterized="true"/>
15+
</section>
16+
</sections>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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="AdminNameEmptyForGuestTest">
12+
<annotations>
13+
<features value="Newsletter"/>
14+
<group value="Newsletter"/>
15+
<title value="Empty name for Guest Customer"/>
16+
<description value="'Customer First Name' and 'Customer Last Name' should be empty for Guest Customer in Newsletter Subscribers Grid"/>
17+
<severity value="MINOR"/>
18+
</annotations>
19+
20+
<before>
21+
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
24+
<after>
25+
<actionGroup ref="logout" stepKey="adminLogout"/>
26+
</after>
27+
28+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/>
29+
<waitForPageLoad stepKey="waitForCustomerPage"/>
30+
<scrollTo selector="{{StorefrontCustomerFooterSection.footerBlock}}" stepKey="scrollToFooter"/>
31+
<fillField userInput="{{Simple_US_Customer.email}}" selector="{{StorefrontCustomerFooterSection.formSubscribe}}"
32+
stepKey="giveEmail"/>
33+
<click selector="{{StorefrontCustomerFooterSection.buttonSubscribe}}" stepKey="clickSubscribeButton"/>
34+
<waitForPageLoad stepKey="waitForPageLoad"/>
35+
<see selector="{{StorefrontCustomerMessagesSection.successMessage}}"
36+
userInput="Thank you for your subscription." stepKey="checkSuccessMessage"/>
37+
38+
<amOnPage url="{{AdminNewsletterSubscriberPage.url}}" stepKey="amOnNewsletterSubscribersPage"/>
39+
<see selector="{{AdminNewsletterSubscriberGridSection.email('1')}}" userInput="{{Simple_US_Customer.email}}"
40+
stepKey="checkEmail"/>
41+
<see selector="{{AdminNewsletterSubscriberGridSection.type('1')}}" userInput="Guest" stepKey="checkType"/>
42+
<see selector="{{AdminNewsletterSubscriberGridSection.firstName('1')}}" userInput="" stepKey="checkFirstName"/>
43+
<see selector="{{AdminNewsletterSubscriberGridSection.lastName('1')}}" userInput="" stepKey="checkLastName"/>
44+
</test>
45+
</tests>

0 commit comments

Comments
 (0)