Skip to content

Commit

Permalink
Admin Delete Wishlist Item Test
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryTsymbal committed Jun 9, 2020
1 parent f571e90 commit 6f824a9
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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="AdminCustomerDeleteWishlistItemActionGroup">
<click selector="{{AdminCustomerWishlistSection.deleteButton}}" stepKey="clickDeleteButton"/>
<waitForPageLoad stepKey="waitForResultsLoading"/>
<click selector="{{AdminCustomerWishlistSection.deleteConfirm}}" stepKey="confirmDeleting"/>
<waitForPageLoad stepKey="waitForPageLoading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AdminCustomerFindWishlistItemActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<fillField userInput="{{productName}}" selector="{{AdminCustomerWishlistSection.productName}}" stepKey="fillProductNameField"/>
<click selector="{{AdminCustomerWishlistSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForGridLoading"/>
</actionGroup>
</actionGroups>
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminNavigateCustomerWishlistTabActionGroup">
<click selector="{{AdminCustomerInformationSection.wishList}}" stepKey="clickWishlistButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="AssertAdminCustomerNoItemsInWishlistActionGroup">
<see userInput="No Items Found" selector="{{AdminCustomerWishlistSection.gridTable}}" stepKey="assertNoItems"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminCustomerWishlistSection">
<element name="productName" type="input" selector="#wishlistGrid_filter_product_name"/>
<element name="searchButton" type="button" selector=".action-default.scalable.action-secondary"/>
<element name="deleteButton" type="text" selector=".even > td:nth-child(7) > a:nth-child(1)"/>
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept"/>
<element name="gridTable" type="text" selector="#wishlistGrid_table"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?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="AdminDeleteCustomerWishlistItemTest">
<annotations>
<features value="Wishlist"/>
<stories value="Wishlist items deleting"/>
<title value="Admin deletes an item from customer wishlist"/>
<description value="Admin Should be able delete items from customer wishlist"/>
<group value="wishlist"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
<argument name="Customer" value="$createCustomer$"/>
</actionGroup>
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
<argument name="category" value="$createCategory$"/>
<argument name="product" value="$createProduct$"/>
</actionGroup>
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
<argument name="productVar" value="$createProduct$"/>
</actionGroup>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logout"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="navigateToCustomerEditPage">
<argument name="customer" value="$createCustomer$"/>
</actionGroup>
<actionGroup ref="AdminNavigateCustomerWishlistTabActionGroup" stepKey="navigateToWishlistTab"/>
<actionGroup ref="AdminCustomerFindWishlistItemActionGroup" stepKey="findWishlistItem">
<argument name="productName" value="$$createProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminCustomerDeleteWishlistItemActionGroup" stepKey="deleteItem"/>
<actionGroup ref="AssertAdminCustomerNoItemsInWishlistActionGroup" stepKey="assertNoItems"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginOnStoreFront">
<argument name="Customer" value="$createCustomer$"/>
</actionGroup>
<actionGroup ref="NavigateThroughCustomerTabsActionGroup" stepKey="navigateToWishlist">
<argument name="navigationItemName" value="My Wish List"/>
</actionGroup>
<actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertNoItemsInWishlist"/>
</test>
</tests>

0 comments on commit 6f824a9

Please sign in to comment.