-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathStorefrontCreateOrderAllQuantityConfigurableProductCustomStockTest.xml
More file actions
101 lines (98 loc) · 6.37 KB
/
StorefrontCreateOrderAllQuantityConfigurableProductCustomStockTest.xml
File metadata and controls
101 lines (98 loc) · 6.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?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="StorefrontCreateOrderAllQuantityConfigurableProductCustomStockTest">
<annotations>
<stories value="Configurable Product Custom Stock."/>
<title value="Place order with all quantity with configurable product on custom stock."/>
<description value="Verify, configurable product will change status after order placement with all it's quantity on custom stock."/>
<severity value="MAJOR"/>
<group value="msi"/>
<group value="multi_mode"/>
</annotations>
<before>
<!--Create test data.-->
<createData entity="SimpleSubCategory" stepKey="category"/>
<createData entity="ApiConfigurableProduct" stepKey="configurableProduct">
<requiredEntity createDataKey="category"/>
</createData>
<createData entity="productAttributeWithTwoOptions" stepKey="configurableProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="configurableProductAttributeOption">
<requiredEntity createDataKey="configurableProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="configurableProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption">
<requiredEntity createDataKey="configurableProductAttribute"/>
</getData>
<createData entity="ApiSimpleOne" stepKey="configurableChildProduct">
<requiredEntity createDataKey="configurableProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
</createData>
<createData entity="ConfigurableProductOneOption" stepKey="configurableProductOption">
<requiredEntity createDataKey="configurableProduct"/>
<requiredEntity createDataKey="configurableProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="configurableProductAddChild">
<requiredEntity createDataKey="configurableProduct"/>
<requiredEntity createDataKey="configurableChildProduct"/>
</createData>
<createData entity="Simple_US_Customer" stepKey="customer"/>
<createData entity="_minimalSource" stepKey="source"/>
<createData entity="BasicMsiStockWithMainWebsite1" stepKey="stock"/>
<createData entity="SourceStockLinked1" stepKey="sourceStockLink">
<requiredEntity createDataKey="stock"/>
<requiredEntity createDataKey="source"/>
</createData>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
<!--Assign additional source to configurable product.-->
<amOnPage url="{{AdminProductEditPage.url($configurableChildProduct.id$)}}" stepKey="openProductEditPage"/>
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct">
<argument name="sourceCode" value="{{_defaultSource.name}}"/>
</actionGroup>
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignSourceToProduct">
<argument name="sourceCode" value="$source.source[source_code]$"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
</before>
<after>
<deleteData createDataKey="configurableProduct" stepKey="deleteConfigurableProduct"/>
<deleteData createDataKey="configurableChildProduct" stepKey="deleteConfigurableProductVariation1"/>
<deleteData createDataKey="configurableProductAttribute" stepKey="deleteConfigurableProductAttribute"/>
<!--Assign Default Stock to Main Website.-->
<actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock">
<argument name="stockName" value="{{_defaultStock.name}}"/>
<argument name="websiteName" value="{{_defaultWebsite.name}}"/>
</actionGroup>
<deleteData createDataKey="stock" stepKey="deleteStock"/>
<!--Disable source.-->
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminArea"/>
</after>
<!--Add configurable product to cart.-->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
<argument name="Customer" value="$customer$" />
</actionGroup>
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart">
<argument name="urlKey" value="$configurableProduct.custom_attributes[url_key]$" />
<argument name="productAttribute" value="$configurableProductAttribute.default_value$"/>
<argument name="productOption" value="$getConfigAttributeOption.value$"/>
<argument name="qty" value="{{defaultProductQty.value}}"/>
</actionGroup>
<!--Place order.-->
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutPage"/>
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/>
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
<magentoCLI command="queue:consumers:start inventory.reservations.updateSalabilityStatus" stepKey="updateSalability"/>
<!--Verify, configurable product has 'out of stock' status.-->
<amOnPage url="{{StorefrontProductPage.url($configurableProduct.custom_attributes[url_key]$)}}" stepKey="navigateToConfigurablePDP"/>
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{SourceStatusOutOfStock.value}}" stepKey="verifyProductStatus"/>
</test>
</tests>