|
11 | 11 | <features value="Shipping"/> |
12 | 12 | <stories value="Offline Shipping Methods"/> |
13 | 13 | <title value="Import table rate shipping prices with specific amount including and excluding virtual products"/> |
14 | | - <description value="Admin Should Able to import table rate shipping prices with specific amount with Virtual Products as per Configuration"/> |
| 14 | + <description value="Admin imports table rate shipping prices with specific amount including and excluding virtual products and validates the shipping cost reflects as per the configurations"/> |
15 | 15 | <severity value="MAJOR"/> |
16 | 16 | <testCaseId value="AC-13526"/> |
17 | 17 | <group value="shipping"/> |
18 | 18 | </annotations> |
19 | 19 | <before> |
20 | 20 | <!--Create customer--> |
21 | | - <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> |
| 21 | + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> |
22 | 22 | <!-- Add simple product --> |
23 | 23 | <createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"> |
24 | 24 | <field key="price">9.00</field> |
|
30 | 30 | <field key="price">64.00</field> |
31 | 31 | </createData> |
32 | 32 | <createData entity="ApiVirtualProductWithDescription" stepKey="createVirtualProduct"/> |
33 | | - <magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> |
34 | 33 | </before> |
35 | 34 | <after> |
36 | | - <!-- Roll back configuration --> |
37 | | - <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 35 | + <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/> |
| 36 | + <!-- Remove simple products--> |
| 37 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 38 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 39 | + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
| 40 | + <!-- Delete sales rule --> |
| 41 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
38 | 42 | <!-- Go to Stores > Configuration > Sales > Shipping Methods --> |
39 | 43 | <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> |
40 | | - <!-- Switch to Website scope --> |
41 | | - <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreView"> |
42 | | - <argument name="website" value="_defaultWebsite"/> |
43 | | - </actionGroup> |
44 | 44 | <!-- Check Use Default checkbox for Default Condition and Active --> |
45 | 45 | <checkOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateConditionName}}" stepKey="enableUseDefaultCondition"/> |
46 | 46 | <checkOption selector="{{AdminShippingMethodTableRatesSection.enabledUseSystemValue}}" stepKey="enableUseDefaultActive"/> |
47 | 47 | <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> |
48 | 48 | <!-- Log out --> |
49 | 49 | <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
50 | 50 | <!-- Remove Virtual products--> |
51 | | - <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/> |
52 | | - <!-- Remove simple products--> |
53 | | - <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
54 | | - <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
55 | | - <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> |
56 | | - <!-- Delete sales rule --> |
57 | | - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
58 | 51 | </after> |
59 | 52 | <!-- Login as admin --> |
60 | 53 | <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
|
72 | 65 | <selectOption selector="{{AdminShippingMethodTableRatesSection.condition}}" userInput="{{TableRateShippingMethodConfig.package_value_with_discount}}" stepKey="setCondition"/> |
73 | 66 | <!-- Uncheck Use Default checkbox for include virtual price --> |
74 | 67 | <uncheckOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPrice}}" stepKey="uncheckIncludeVirtualPrice"/> |
75 | | - <selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPriceDropdown}}" userInput="No" stepKey="setIncludeVirtualPriceAsYes"/> |
| 68 | + <selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPriceDropdown}}" userInput="No" stepKey="setIncludeVirtualPriceAsNo"/> |
76 | 69 | <!-- Import file and save config --> |
77 | 70 | <attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="usa_tablerates.csv" stepKey="attachFileForImport"/> |
78 | 71 | <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> |
|
83 | 76 | <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
84 | 77 | <argument name="Customer" value="$$createCustomer$$" /> |
85 | 78 | </actionGroup> |
86 | | - <actionGroup ref="StorefrontAddNewCustomerAddressActionGroup" stepKey="AddNewAddress"> |
87 | | - <argument name="Address" value="US_Address_Custom"/> |
88 | | - </actionGroup> |
| 79 | + <amOnPage url="customer/address" stepKey="OpenCustomerAddNewAddress"/> |
| 80 | + <waitForPageLoad stepKey="waitForShippingAddressPageToLoad"/> |
| 81 | + <!--Open change shipping address page--> |
| 82 | + <waitForElementClickable selector="{{StorefrontCustomerAddressesSection.changeShippingAddress}}" stepKey="waitForChangeShippingAddress"/> |
| 83 | + <click selector="{{StorefrontCustomerAddressesSection.changeShippingAddress}}" stepKey="openChangeShippingAddress"/> |
| 84 | + <clearField stepKey="clearZip" selector="{{StorefrontCustomerAddressFormSection.zip}}"/> |
| 85 | + <fillField stepKey="fillZip" userInput="20011" selector="{{StorefrontCustomerAddressFormSection.zip}}"/> |
| 86 | + <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> |
| 87 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
89 | 88 | <!-- Add simple product to cart --> |
90 | 89 | <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
91 | 90 | <argument name="product" value="$$createFirstSimpleProduct$$"/> |
92 | 91 | </actionGroup> |
93 | 92 | <!-- Assert that table rate value is correct for US --> |
94 | 93 | <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckout"/> |
95 | | - <waitForElement time="30" selector="{{CheckoutCartSummarySection.estimateShippingAndTaxForm}}" stepKey="waitForEstimateShippingAndTaxForm"/> |
96 | 94 | <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> |
97 | 95 | <scrollTo selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="scrollToShippingForUS"/> |
98 | | - <grabTextFrom selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="grabTableratePrice5"/> |
99 | | - <assertStringContainsString stepKey="checkCustomerShippingPrice5"> |
100 | | - <expectedResult type="string">$6.99</expectedResult> |
101 | | - <actualResult type="variable">grabTableratePrice5</actualResult> |
102 | | - </assertStringContainsString> |
103 | | - <waitForText selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> |
104 | | - <waitForText selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="California" stepKey="selectCaliforniaRegion"/> |
105 | | - <waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="selectZipCode"/> |
106 | | - <grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/> |
107 | | - <assertEquals message="pass" stepKey="checkCustomerPostcode"> |
108 | | - <expectedResult type="string">{{US_Address_Custom.postcode}}</expectedResult> |
109 | | - <actualResult type="variable">grabTextPostCode</actualResult> |
110 | | - </assertEquals> |
| 96 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$6.99" stepKey="seeShippingForUS1"/> |
111 | 97 | <waitForPageLoad stepKey="waitForSelectCountry"/> |
112 | | - <!-- Add simple product to cart --> |
| 98 | + <!-- Add Virtual product to cart --> |
113 | 99 | <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondProductToCart1"> |
114 | 100 | <argument name="product" value="$$createVirtualProduct$$"/> |
115 | 101 | </actionGroup> |
116 | 102 | <!-- Assert that table rate value is correct for US --> |
117 | 103 | <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goAgainToCheckout"/> |
118 | | - <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax1"/> |
119 | | - <grabTextFrom selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="grabTableratePrice2"/> |
120 | | - <assertStringContainsString stepKey="checkCustomerShippingPrice2"> |
121 | | - <expectedResult type="string">$6.99</expectedResult> |
122 | | - <actualResult type="variable">grabTableratePrice2</actualResult> |
123 | | - </assertStringContainsString> |
124 | | - <!-- Assert product details in Mini Cart --> |
| 104 | + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandToEstimateShippingandTax1"/> |
| 105 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$6.99" stepKey="seeShippingForUS"/> |
| 106 | + <!-- Customer Click On Mini Cart --> |
125 | 107 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> |
126 | 108 | <!--Remove an item from the cart using minicart--> |
127 | 109 | <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> |
|
135 | 117 | <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToToCheckout"/> |
136 | 118 | <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingPrice"/> |
137 | 119 | <grabTextFrom selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="grabTableratePrice1"/> |
138 | | - <assertStringContainsString stepKey="checkCustomerShippingPrice1"> |
139 | | - <expectedResult type="string">$6.99</expectedResult> |
140 | | - <actualResult type="variable">grabTableratePrice1</actualResult> |
141 | | - </assertStringContainsString> |
| 120 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$6.99" stepKey="seeShippingForUS2"/> |
142 | 121 | <!-- Assert product details in Mini Cart --> |
143 | 122 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart1"/> |
144 | 123 | <!--Remove an item from the cart using minicart--> |
|
152 | 131 | <!-- Assert that table rate value is correct for US --> |
153 | 132 | <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateAgainToToCheckout"/> |
154 | 133 | <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingPrice1"/> |
155 | | - <grabTextFrom selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="grabTableratePrice3"/> |
156 | | - <assertStringContainsString stepKey="checkCustomerShippingPrice3"> |
157 | | - <expectedResult type="string">$4.99</expectedResult> |
158 | | - <actualResult type="variable">grabTableratePrice3</actualResult> |
159 | | - </assertStringContainsString> |
| 134 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$4.99" stepKey="seeShippingForUS3"/> |
160 | 135 | <!-- Assert product details in Mini Cart --> |
161 | 136 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart2"/> |
162 | 137 | <!--Remove an item from the cart using minicart--> |
|
168 | 143 | <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingPrice2"/> |
169 | 144 | <waitForElementNotVisible selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="dontSeeShippingPriceForUS"/> |
170 | 145 | <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openAgainShippingMethodConfigPage"/> |
171 | | - <!-- Enable Table Rate method and save config --> |
172 | | - <actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethod1"/> |
173 | | - <scrollTo selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPriceDropdown}}" stepKey="scrollToIncludeVirtualPrice"/> |
174 | | - <selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPriceDropdown}}" userInput="Yes" stepKey="setIncludeVirtualPriceAsNo"/> |
| 146 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreView1"> |
| 147 | + <argument name="website" value="_defaultWebsite"/> |
| 148 | + </actionGroup> |
| 149 | + <selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateIncludeVirtualPriceDropdown}}" userInput="Yes" stepKey="setIncludeVirtualPriceAsYes"/> |
175 | 150 | <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> |
176 | 151 | <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="navigateToStorefront"/> |
177 | 152 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart3"/> |
|
182 | 157 | <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
183 | 158 | <argument name="product" value="$$createFirstSimpleProduct$$"/> |
184 | 159 | </actionGroup> |
| 160 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goAgainToCheckout3"/> |
| 161 | + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax1" /> |
| 162 | + <scrollTo selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="scrollAgainToShippingForUS"/> |
| 163 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$6.99" stepKey="seeShippingForUS5"/> |
185 | 164 | <!-- Add Virtual product to cart --> |
186 | 165 | <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addVirtualProductToCart"> |
187 | 166 | <argument name="product" value="$$createVirtualProduct$$"/> |
188 | 167 | </actionGroup> |
189 | 168 | <!-- Assert that table rate value is correct for US --> |
190 | 169 | <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goAgainToCheckout2"/> |
191 | 170 | <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateTableRatePrice"/> |
192 | | - <grabTextFrom selector="{{CheckoutCartSummarySection.shippingPrice}}" stepKey="grabTableratePrice4"/> |
193 | | - <assertStringContainsString stepKey="checkCustomerShippingPrice"> |
194 | | - <expectedResult type="string">$6.99</expectedResult> |
195 | | - <actualResult type="variable">grabTableratePrice4</actualResult> |
196 | | - </assertStringContainsString> |
| 171 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$4.99" stepKey="seeShippingForUS4"/> |
197 | 172 | </test> |
198 | 173 | </tests> |
0 commit comments