Skip to content

Commit 9e3eca5

Browse files
committed
Convert ShareWishlistEntityTest to MFTF
1 parent d51b0a1 commit 9e3eca5

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList"/>
2929
<click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist" />
3030
<waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/>
31-
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}"
32-
userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping."
33-
stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
31+
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
3432
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
3533
</actionGroup>
3634

@@ -93,18 +91,12 @@
9391

9492
<!-- Share wishlist -->
9593
<actionGroup name="StorefrontCustomerShareWishlistActionGroup">
96-
<click selector="{{StorefrontCustomerWishlistProductSection.ProductShareWishList}}"
94+
<click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}"
9795
stepKey="clickMyWishListButton"/>
9896
<amOnPage url="{{StorefrontCustomerWishlistSharePage.url}}" stepKey="amOnShareWishlist"/>
99-
<fillField userInput="{{Wishlist.shareInfo_emails}}"
100-
selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}"
101-
stepKey="fillEmailsForShare"/>
102-
<fillField userInput="{{Wishlist.shareInfo_message}}"
103-
selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}"
104-
stepKey="fillShareMessage"/>
105-
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}"
106-
stepKey="sendWishlist"/>
107-
<see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessShareMessage}}"
108-
userInput="Your wish list has been shared." stepKey="successMessage"/>
97+
<fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/>
98+
<fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/>
99+
<click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/>
100+
<see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/>
109101
</actionGroup>
110102
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Page/StorefrontCustomerWishlistSharePage.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11-
<page name="StorefrontCustomerWishlistSharePage" url="/wishlist/index/share/wishlist_id/{{var1}}/"
12-
area="storefront" module="Magento_Wishlist">
11+
<page name="StorefrontCustomerWishlistSharePage" url="/wishlist/index/share/wishlist_id/{{wishlistId}}/" area="storefront" module="Magento_Wishlist">
1312
<section name="StorefrontCustomerWishlistShareSection"/>
1413
</page>
1514
</pages>

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<element name="ProductQuantity" type="input" selector="//a[contains(text(), '{{productName}}')]/ancestor::div[@class='product-item-info']//input[@class='input-text qty']" parameterized="true"/>
2020
<element name="ProductUpdateWishList" type="button" selector=".column.main .actions-toolbar .action.update" timeout="30"/>
2121
<element name="ProductAddAllToCart" type="button" selector=".column.main .actions-toolbar .action.tocart" timeout="30"/>
22-
<element name="ProductShareWishList" type="button" selector=".column.main .actions-toolbar .action.share" timeout="30" />
22+
<element name="productShareWishList" type="button" selector="button.action.share" timeout="30" />
2323
<element name="ProductSuccessUpdateMessage" type="text" selector="//div[1]/div[2]/div/div/div"/>
24-
<element name="ProductSuccessShareMessage" type="text" selector="//main/div[1]/div[2]/div/div/div"/>
24+
<element name="productSuccessShareMessage" type="text" selector="div.message-success"/>
2525
</section>
2626
</sections>

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistShareSection.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<section name="StorefrontCustomerWishlistShareSection">
1212
<element name="ProductShareWishlistEmail" type="input" selector="#email_address"/>
1313
<element name="ProductShareWishlistTextMessage" type="input" selector="#message"/>
14-
<element name="ProductShareWishlistButton" type="button"
15-
selector="//*[@class='action submit primary']" timeout="30"/>
14+
<element name="ProductShareWishlistButton" type="button" selector=".action.submit.primary" timeout="30"/>
1615
</section>
1716
</sections>

app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontShareWishlistEntityTest.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
<description value="Customer should be able to share a persistent wishlist"/>
1717
<severity value="AVERAGE"/>
1818
<group value="wishlist"/>
19-
<testCaseId value="MAGETWO-23394"/>
19+
<testCaseId value="MC-13976"/>
20+
<group value="wishlist"/>
21+
<group value="mtf_migrated"/>
2022
</annotations>
2123
<before>
2224
<createData entity="SimpleSubCategory" stepKey="category"/>
@@ -29,7 +31,6 @@
2931
<deleteData createDataKey="category" stepKey="deleteCategory"/>
3032
<deleteData createDataKey="product" stepKey="deleteProduct"/>
3133
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
32-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
3334
</after>
3435

3536
<!-- Sign in as customer -->
@@ -47,5 +48,7 @@
4748
</actionGroup>
4849

4950
<actionGroup ref="StorefrontCustomerShareWishlistActionGroup" stepKey="shareWishlist"/>
51+
52+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
5053
</test>
5154
</tests>

dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Wishlist\Test\TestCase\ShareWishlistEntityTest" summary="Share wishlist" ticketId="MAGETWO-23394">
1010
<variation name="ShareWishlistEntityTestVariation1">
11+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1112
<data name="sharingInfo/emails" xsi:type="string">[email protected],[email protected],[email protected]</data>
1213
<data name="sharingInfo/message" xsi:type="string">Sharing message.</data>
1314
<constraint name="Magento\Wishlist\Test\Constraint\AssertWishlistShareMessage" />

0 commit comments

Comments
 (0)