Skip to content

MFTF: Admin Deletes Customer's Wishlist Item Test #28632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="#wishlistGrid button[data-action='grid-filter-apply']"/>
<element name="deleteButton" type="text" selector="//*[@id='wishlistGrid_table']//*[@data-column='action']//*[text()='Delete']"/>
<element name="deleteConfirm" type="button" selector=".modal-popup.confirm .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,65 @@
<?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"/>
<testCaseId value="MC-35170"/>
<group value="wishlist"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bear in mind that tests might be run in "on schedule" indexing mode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added cron cli

<magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/>
<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>