Skip to content

Commit 0c78307

Browse files
Merge branch 'ACQE-8458' into ACQE-functional-deployment-v3-3
2 parents 2452012 + c789a3d commit 0c78307

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminUnassignAllWebsitesFromProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create multi-website and multi-store, assign product to both, then unassign all websites and save."/>
15+
<title value="Unassign all websites from a product and set visibility to Not Visible Individually"/>
16+
<description value="Validate Removing a product from all websites in admin the product is saved successfully"/>
17+
<testCaseId value="AC-3653"/>
18+
<severity value="AVERAGE"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Pre-condition 1: Create product -->
23+
<createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/>
24+
<!-- Pre-condition 2: Create a second website, store and store view -->
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite">
27+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
28+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStore">
31+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
32+
<argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/>
33+
<argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
36+
<argument name="StoreGroup" value="SecondStoreGroupUnique"/>
37+
<argument name="customStore" value="SecondStoreUnique"/>
38+
</actionGroup>
39+
</before>
40+
<after>
41+
<!-- Delete product -->
42+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct">
43+
<argument name="sku" value="{{defaultSimpleProduct.sku}}"/>
44+
</actionGroup>
45+
<!-- Delete the second website -->
46+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite">
47+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
50+
</after>
51+
<!-- Step 1: Go to Admin panel, navigate to product -->
52+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductGrid"/>
53+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
54+
<argument name="productId" value="$$createSimpleProduct.id$$"/>
55+
</actionGroup>
56+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="addProductToWebsite">
57+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
58+
</actionGroup>
59+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="addProductToWeb">
60+
<argument name="website" value="{{_defaultWebsite.name}}"/>
61+
</actionGroup>
62+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
63+
<!-- Step 2: Edit the product and set the visibility to "not visible individually", navigate to products and website section and uncheck all the websites and save the product-->
64+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPageAgain">
65+
<argument name="productId" value="$$createSimpleProduct.id$$"/>
66+
</actionGroup>
67+
<!-- Set visibility to "not visible individually" -->
68+
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="setVisibilityNotVisibleIndividually"/>
69+
<!-- Uncheck all websites -->
70+
<actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignCreatedWebsiteInProduct">
71+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
72+
</actionGroup>
73+
<actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct">
74+
<argument name="website" value="{{_defaultWebsite.name}}"/>
75+
</actionGroup>
76+
<!-- Save the product -->
77+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProductAfterUpdate"/>
78+
<!-- Step 3: Verify the product is saved successfully -->
79+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
80+
</test>
81+
</tests>

0 commit comments

Comments
 (0)