Skip to content

Commit 3b2f28e

Browse files
authored
Merge pull request #282 from magento-gl/ACQE-4191
Acqe 4191
2 parents 74c126a + 2d9cc64 commit 3b2f28e

File tree

2 files changed

+326
-0
lines changed

2 files changed

+326
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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="SimpleProductAssignedToTestWebsiteButNotAssignedToAnySourceCreatedByAdminUserTest">
12+
<annotations>
13+
<stories value="Simple Product assigned to Test website but not assigned to any source created by Admin user"/>
14+
<title value="Simple Product assigned to Test website but not assigned to any source created by Admin user"/>
15+
<description value="Simple Product assigned to Test website but not assigned to any source created by Admin user"/>
16+
<testCaseId value="AC-6512"/>
17+
<severity value="MAJOR"/>
18+
<group value="msi"/>
19+
<group value="multi_mode"/>
20+
</annotations>
21+
<before>
22+
<!-- Step1 Login to backend as admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<magentoCLI stepKey="setDisplayOutOfStockProductAsNo" command="config:set cataloginventory/options/show_out_of_stock 0" />
25+
<actionGroup ref="AdminGoToConfigurationPageEnableDisableManageStock" stepKey="enableManageStockAsYes">
26+
<argument name="manageStockValue" value="Yes"/>
27+
</actionGroup>
28+
</before>
29+
<after>
30+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/>
31+
<magentoCLI stepKey="setDisplayOutOfStockProductAsYes" command="config:set cataloginventory/options/show_out_of_stock 1" />
32+
<actionGroup ref="AdminSetWebsiteAsDefaultActionGroup" stepKey="SetTheMainWebsiteAsDefault">
33+
<argument name="WebsiteName" value="Main Website"/>
34+
</actionGroup>
35+
<magentoCron groups="index" stepKey="reindexForResettingTheMainWebsite"/>
36+
<actionGroup ref="AdminDeleteStockActionGroup" stepKey="deleteCreatedStock">
37+
<argument name="stockName" value="Test Stock 1"/>
38+
<argument name="websiteName" value="{{customWebsite.name}}"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminGoToConfigurationPageEnableDisableManageStock" stepKey="enableManageStockBackToYes">
41+
<argument name="manageStockValue" value="Yes"/>
42+
</actionGroup>
43+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
44+
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
45+
<actionGroup ref="DisableSourceActionGroup" stepKey="disableSource">
46+
<argument name="sourceCode" value="$createTestSource1.source[source_code]$"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
49+
<argument name="websiteName" value="{{customWebsite.name}}"/>
50+
</actionGroup>
51+
<magentoCron groups="index" stepKey="reindex"/>
52+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
53+
</after>
54+
55+
<!-- Step2 Create website-->
56+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite">
57+
<argument name="newWebsiteName" value="{{customWebsite.name}}"/>
58+
<argument name="websiteCode" value="{{customWebsite.code}}"/>
59+
</actionGroup>
60+
61+
<!-- Step3 Create second store -->
62+
<actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore">
63+
<argument name="website" value="{{customWebsite.name}}"/>
64+
<argument name="store" value="{{customStoreGroup.name}}"/>
65+
<argument name="rootCategory" value="Default Category"/>
66+
</actionGroup>
67+
<!-- Step4 Create second store view -->
68+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
69+
<argument name="StoreGroup" value="customStoreGroup"/>
70+
<argument name="customStore" value="customStoreEN"/>
71+
</actionGroup>
72+
73+
<!-- Step5 Set Add Store Code to URL as Yes -->
74+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/>
75+
76+
<!-- Step6 perform re-indexing and cache flush -->
77+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
78+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
79+
80+
<!-- Step7 and 8 Create New Source -->
81+
<createData entity="FullSource1" stepKey="createTestSource1"/>
82+
83+
<!-- Step9 and 10 Create the stock from UI, assign the sources and assign Test Website as Sales Channel-->
84+
<actionGroup ref="AdminCreateNewStockActionGroup" stepKey="createNewStockWithTestWebsite">
85+
<argument name="assignSource" value="$$createTestSource1.source[name]$$"/>
86+
<argument name="stockName" value="Test Stock 1"/>
87+
<argument name="websiteName" value="{{customWebsite.name}}"/>
88+
</actionGroup>
89+
90+
<!-- Step11 Create New Category under default category -->
91+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
92+
93+
<!-- Step12 enable display out of stock products as enabled-->
94+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 1" stepKey="setDisplayOutOfStockProductOnConfigPage"/>
95+
96+
<!-- Step13 perform cache flush -->
97+
<magentoCLI command="cache:flush" stepKey="flushCachePostDeisplayOutOfStockProductAsYes"/>
98+
99+
<!-- Step14 Create Simple Product and assign to subcategory-->
100+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
101+
<requiredEntity createDataKey="createSubCategory" />
102+
</createData>
103+
104+
<!-- Step15 Set the Test Website for Simple Product -->
105+
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSimpleProductForEdit">
106+
<argument name="productSku" value="$$createSimpleProduct.sku$$"/>
107+
</actionGroup>
108+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToCustomWebsite">
109+
<argument name="website" value="{{customWebsite.name}}"/>
110+
</actionGroup>
111+
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="unselectMainWebsite"/>
112+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>
113+
114+
<!-- Step16.1 Switch to Test website -->
115+
<actionGroup ref="AdminSetWebsiteAsDefaultActionGroup" stepKey="SetTheTestWebsiteAsDefault">
116+
<argument name="WebsiteName" value="{{customWebsite.name}}"/>
117+
</actionGroup>
118+
119+
<magentoCLI command="indexer:reindex" stepKey="reindexPostSwitchingToTestWebsite"/>
120+
<magentoCLI command="cache:flush" stepKey="flushCachePostSwitchingToTestWebsite"/>
121+
122+
<!-- Step16.2 Navigate to Test website -->
123+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="navigateToCategoryPage"/>
124+
<waitForPageLoad stepKey="waitForHomePageLoad"/>
125+
<click selector="{{StorefrontNavigationSection.topCategory($$createSubCategory.name$$)}}" stepKey="NavigateToCategoryOnStorefront"/>
126+
127+
<see userInput="$$createSimpleProduct.name$$" stepKey="assertProductPresent"/>
128+
<see userInput="$$createSimpleProduct.price$$" stepKey="assertProductPricePresent"/>
129+
130+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProductOnCategoryPage"/>
131+
<seeElement selector="{{StorefrontCategoryMainSection.outOfStockProductCategoryPage}}" stepKey="SeeOutOfStockProductOnCategoryPage" />
132+
<click selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="NavigateToProduct"/>
133+
134+
<!-- Assert the product name, sku and the out of stock status for the product -->
135+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="grabStoreFrontProductName"/>
136+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="grabStoreFrontProductSKU"/>
137+
138+
<assertEquals message="Verify the product name on product section of storefront" stepKey="assertProductNameOnStorefront">
139+
<expectedResult type="string">$$createSimpleProduct.name$$</expectedResult>
140+
<actualResult type="string">$grabStoreFrontProductName</actualResult>
141+
</assertEquals>
142+
<assertEquals message="Verify the product sku on product section of storefront" stepKey="assertProductSkuOnStorefront">
143+
<expectedResult type="string">$$createSimpleProduct.sku$$</expectedResult>
144+
<actualResult type="string">$grabStoreFrontProductSKU</actualResult>
145+
</assertEquals>
146+
<seeElement selector="{{StorefrontCategoryMainSection.outOfStockProductCategoryPage}}" stepKey="SeeOutOfStockProductOnProductPage" />
147+
148+
</test>
149+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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="LoggedInCustomerPlaceOrderWithPickupInStoreMethodWithGoogleAPIEnabledTest">
12+
<annotations>
13+
<stories value="Simple Product Custom Stock."/>
14+
<title value="Logged in customer place order with Pickup In store method with Google API enabled."/>
15+
<description value="Logged in customer place order with Pickup In store method with Google API enabled."/>
16+
<testCaseId value="ACQE-4014"/>
17+
<severity value="CRITICAL"/>
18+
</annotations>
19+
20+
<before>
21+
22+
<!--Enable Store pickup-->
23+
<magentoCLI command="config:set {{EnableInStorePickup.path}} {{EnableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/>
24+
25+
<!--Enable Distance Provider for Distance Based SSA to online-->
26+
<magentoCLI command="config:set {{OnlineDistanceProviderForDistanceBasedSSA.path}} {{OnlineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOnline"/>
27+
28+
<!--Clean chache and reindex-->
29+
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
30+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
31+
32+
<createData entity="CulverStorePickupEnabledSource2" stepKey="createSource1"/>
33+
<createData entity="AustinStorePickupEnabledSource" stepKey="createSource2"/>
34+
<createData entity="BasicMsiStockWithMainWebsite1" stepKey="createStock"/>
35+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
36+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
37+
<createData entity="_defaultCategory" stepKey="category"/>
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
</before>
40+
<after>
41+
<actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock">
42+
<argument name="stockName" value="{{_defaultStock.name}}"/>
43+
<argument name="websiteName" value="{{_defaultWebsite.name}}"/>
44+
</actionGroup>
45+
<!--Set Distance Provider for Distance Based SSA to offline-->
46+
<magentoCLI command="config:set {{OfflineDistanceProviderForDistanceBasedSSA.path}} {{OfflineDistanceProviderForDistanceBasedSSA.value}}" stepKey="setDistanceProviderToOffline"/>
47+
<!--Disable 'In Store Pickup' shipping method.-->
48+
<magentoCLI command="config:set {{DisableInStorePickup.path}} {{DisableInStorePickup.value}}" stepKey="enableInStorePickupMethod"/>
49+
50+
<deleteData createDataKey="createStock" stepKey="deleteStock"/>
51+
52+
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/>
53+
54+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
55+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
56+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
57+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
58+
</after>
59+
60+
<amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/>
61+
<waitForPageLoad stepKey="waitForConfigPageToLoad"/>
62+
<conditionalClick stepKey="expandGoogledistanceProvider" selector="{{InventoryConfigSection.GoogleDistanceProvidedTab}}" dependentSelector="{{InventoryConfigSection.GoogleDistanceProvidedTabExpanded}}" visible="true"/>
63+
<fillField selector="{{InventoryConfigSection.GoogleDistanceProvided}}" userInput="AIzaSyD7QOaF7rcGVZQwrbG7AYNnFLwyuhGpQBU" stepKey="fillGoogleDistanceProvider"/>
64+
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
65+
<!--Clean chache and reindex-->
66+
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
67+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
68+
69+
<actionGroup ref="AdminGoToStockGridFilterResultsByInputEditStock"
70+
stepKey="goToStockGridFilterResultsByInputEditStock1">
71+
<argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/>
72+
<argument name="filter_value" value="$$createStock.stock[name]$$"/>
73+
</actionGroup>
74+
75+
<!--Assign Sources to stock-->
76+
<actionGroup ref="AdminOnStockEditPageAssignSourceToStock" stepKey="onStockEditPageAssignSourceToStock1">
77+
<argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/>
78+
<argument name="filter_value" value="$$createSource1.source[name]$$"/>
79+
</actionGroup>
80+
81+
<actionGroup ref="AdminOnStockEditPageAssignSourceToStock" stepKey="onStockEditPageAssignSourceToStock2">
82+
<argument name="filter_selector" value="AdminManageStockGridFilterControls.name"/>
83+
<argument name="filter_value" value="$$createSource2.source[name]$$"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAndClose1"/>
86+
87+
<!--Go to product and open product to edit-->
88+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
89+
<argument name="productId" value="$createSimpleProduct.id$"/>
90+
</actionGroup>
91+
92+
<!--Add category to product-->
93+
<actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignProduct">
94+
<argument name="categoryName" value="$$category.name$$"/>
95+
</actionGroup>
96+
97+
<!--Assign Source to product and update quantity-->
98+
<actionGroup ref="AdminOnProductEditPageAssignSourceToProduct" stepKey="AdminOnProductEditPageAssignSourceToProduct1">
99+
<argument name="filter_selector" value="AdminManageSourcesGridFilterControls.code"/>
100+
<argument name="filter_value" value="$$createSource1.source[source_code]$$"/>
101+
</actionGroup>
102+
<actionGroup ref="AdminOnProductEditPageAssignSourceToProduct" stepKey="AdminOnProductEditPageAssignSourceToProduct2">
103+
<argument name="filter_selector" value="AdminManageSourcesGridFilterControls.code"/>
104+
<argument name="filter_value" value="$$createSource2.source[source_code]$$"/>
105+
</actionGroup>
106+
107+
<fillField selector="{{AdminProductSourcesGrid.rowQty('1')}}" userInput="100" stepKey="fillDefaultQuantityField1"/>
108+
<fillField selector="{{AdminProductSourcesGrid.rowQty('2')}}" userInput="100" stepKey="fillDefaultQuantityField2"/>
109+
110+
<!--Save the product-->
111+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/>
112+
113+
<!-- Login as customer -->
114+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
115+
<argument name="Customer" value="$$createCustomer$$"/>
116+
</actionGroup>
117+
118+
<!--Open product in storefront-->
119+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront"/>
120+
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
121+
122+
<!--Add product to cart-->
123+
<actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart">
124+
<argument name="product" value="$$createSimpleProduct$$"/>
125+
<argument name="quantity" value="5"/>
126+
</actionGroup>
127+
128+
<!-- Grab Quantity Value from PDP-->
129+
<grabValueFrom selector="{{StorefrontProductPageSection.qtyInput($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInPDP"/>
130+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickMiniCart"/>
131+
132+
<!-- Grab Quantity Value from MiniCart-->
133+
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInShowMinicart"/>
134+
135+
<!-- Assert Quantity value equals 1 -->
136+
<assertEquals stepKey="assertquantityValuesAreEqualfromProductPage">
137+
<actualResult type="string">$grabProductQtyInShowMinicart</actualResult>
138+
<expectedResult type="string">$grabProductQtyInPDP</expectedResult>
139+
</assertEquals>
140+
141+
<!--Click on Proceed to checkout-->
142+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
143+
<waitForPageLoad stepKey="waitForPageLoad2"/>
144+
145+
<actionGroup ref="StorefrontPickInStoreActionGroup" stepKey="pickInStore"/>
146+
<actionGroup ref="StorefrontPickInStoreNavigateToSelectStoreActionGroup" stepKey="navigateToSelectStores"/>
147+
<!--<actionGroup ref="StorefrontPickInStoreSelectSourceActionGroup" stepKey="selectSource">
148+
<argument name="searchString" value="{{CulverStorePickupEnabledSource2.city}}"/>
149+
<argument name="sourceName" value="$createSource1.source[name]$"/>
150+
</actionGroup>-->
151+
<fillField selector="{{StorefrontPickInStoreModalSection.search}}" userInput="{{CulverStorePickupEnabledSource2.city}}" stepKey="fillSearchField"/>
152+
<clearField selector="{{StorefrontPickInStoreModalSection.search}}" stepKey="resetToDefaultPricePrintedCard"/>
153+
<wait stepKey="waitBeforeIndexerAfterBundle" time="30"/>
154+
155+
<!--Click on ship here for source-->
156+
<click selector="{{StorefrontPickInStoreModalSection.shipBtn($$createSource1.source[name]$$)}}" stepKey="clickShipBtn"/>
157+
<waitForPageLoad stepKey="waitForSourceSelection"/>
158+
159+
<!--Navigate to Payment-->
160+
<actionGroup ref="StorefrontPickInStoreNavigateToPaymentActionGroup" stepKey="navigateToPaymentStep"/>
161+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="clickCheckMoneyOrderPayment"/>
162+
163+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
164+
<waitForPageLoad stepKey="waitForSuccess"/>
165+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
166+
167+
<!--Open recently submitted order-->
168+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
169+
<argument name="orderId" value="{$orderNumber}"/>
170+
</actionGroup>
171+
172+
<!--Verify ship is not present and Notify Order Is Ready For Pickup -->
173+
<actionGroup ref="AdminAssertOrderWithStorePickupShippingMethodActionGroup" stepKey="verifyShippingInformation">
174+
<argument name="sourceName" value="$createSource1.source[name]$"/>
175+
</actionGroup>
176+
</test>
177+
</tests>

0 commit comments

Comments
 (0)