Skip to content

Commit

Permalink
Merge branch '2.4-develop' into mftf-deprecated-GoToAttributeGridPage…
Browse files Browse the repository at this point in the history
…ActionGroup
  • Loading branch information
engcom-Charlie authored Sep 18, 2020
2 parents 41f22a3 + 28020ae commit 705769e
Show file tree
Hide file tree
Showing 41 changed files with 1,320 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
<argument name="tags" value="config"/>
</actionGroup>
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<element name="selectFromGalleryButton" type="button" selector="//*[@class='file-uploader-area']/label[text()='Select from Gallery']"/>
<element name="uploadImageFile" type="input" selector=".file-uploader-area>input"/>
<element name="imageFileName" type="text" selector=".file-uploader-filename"/>
<element name="imageFileMeta" type="text" selector=".file-uploader-meta"/>
<element name="removeImageButton" type="button" selector=".file-uploader-summary .action-remove"/>
<element name="AddCMSBlock" type="select" selector="//*[@name='landing_page']"/>
<element name="description" type="input" selector="//*[@name='description']"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?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="AdminUpdateCategoryWithProductsDefaultSortingTest">
<annotations>
<features value="Catalog"/>
<stories value="Update categories"/>
<title value="Update category, sort products by default sorting"/>
<description value="Login as admin, update category and sort products"/>
<testCaseId value="MC-25667"/>
<severity value="CRITICAL"/>
<group value="catalog"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<createData entity="defaultSimpleProduct" stepKey="simpleProduct" />
<createData entity="_defaultCategory" stepKey="createCategory"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
</after>

<!--Open Category Page-->
<actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage">
<argument name="id" value="$createCategory.id$"/>
</actionGroup>

<!--Update Product Display Setting-->
<waitForElementVisible selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" stepKey="waitForDisplaySettingsSection"/>
<conditionalClick selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" dependentSelector="{{AdminCategoryDisplaySettingsSection.displayMode}}" visible="false" stepKey="openDisplaySettingsSection"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="waitForAvailableProductListCheckbox"/>
<click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Product Name', 'Price']" stepKey="selectPrice"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="waitForDefaultProductList"/>
<click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/>

<!--Add Products in Category-->
<actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductToCategory">
<argument name="productSku" value="$simpleProduct.sku$"/>
</actionGroup>
<actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/>

<!--Verify Category Title-->
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNamePageTitle" />

<!--Verify Category in store front page-->
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openStorefrontCategoryPage"/>

<!--Verify Product in Category-->
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertSimpleProductOnCategoryPage">
<argument name="productName" value="$simpleProduct.name$"/>
</actionGroup>

<!--Verify product name and sku on Store Front-->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductOnStorefrontProductPage">
<argument name="product" value="$simpleProduct$"/>
</actionGroup>
</test>
</tests>

Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminUpdateCategoryWithProductsTest">
<test name="AdminUpdateCategoryWithProductsTest" deprecated="Use AdminUpdateCategoryWithProductsDefaultSortingTest instead">
<annotations>
<stories value="Update categories"/>
<title value="Update category, sort products by default sorting"/>
<title value="DEPRECATED. Update category, sort products by default sorting"/>
<description value="Login as admin, update category and sort products"/>
<testCaseId value="MC-6059"/>
<severity value="BLOCKER"/>
<group value="Catalog"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="DEPRECATED">Use AdminUpdateCategoryWithProductsDefaultSortingTest instead</issueId>
</skip>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
Expand Down
14 changes: 9 additions & 5 deletions app/code/Magento/Checkout/Model/TotalsInformationManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Magento\Checkout\Model;

/**
* Class TotalsInformationManagement
* Class for management of totals information.
*/
class TotalsInformationManagement implements \Magento\Checkout\Api\TotalsInformationManagementInterface
{
Expand Down Expand Up @@ -38,7 +38,7 @@ public function __construct(
}

/**
* {@inheritDoc}
* @inheritDoc
*/
public function calculate(
$cartId,
Expand All @@ -52,16 +52,20 @@ public function calculate(
$quote->setBillingAddress($addressInformation->getAddress());
} else {
$quote->setShippingAddress($addressInformation->getAddress());
$quote->getShippingAddress()->setCollectShippingRates(true)->setShippingMethod(
$addressInformation->getShippingCarrierCode() . '_' . $addressInformation->getShippingMethodCode()
);
if ($addressInformation->getShippingCarrierCode() && $addressInformation->getShippingMethodCode()) {
$quote->getShippingAddress()->setCollectShippingRates(true)->setShippingMethod(
$addressInformation->getShippingCarrierCode().'_'.$addressInformation->getShippingMethodCode()
);
}
}
$quote->collectTotals();

return $this->cartTotalRepository->get($cartId);
}

/**
* Check if quote have items.
*
* @param \Magento\Quote\Model\Quote $quote
* @throws \Magento\Framework\Exception\LocalizedException
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
<argument name="address" defaultValue="US_Address_TX" type="entity"/>
</arguments>
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openShippingDetails"/>
<waitForElementVisible selector="{{CheckoutCartSummarySection.country}}" stepKey="waitForSummarySectionLoad"/>
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country_id}}" stepKey="selectCountry"/>
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}" stepKey="selectState"/>
<waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPostCodeVisible"/>
<fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}" stepKey="selectPostCode"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?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="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest">
<annotations>
<stories value="Checkout"/>
<title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
<description value="Checkout as UK customer with different shipping/billing address and register checkout method"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-28288"/>
<group value="mtf_migrated"/>
<group value="checkout"/>
</annotations>

<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct">
<field key="price">50.00</field>
</createData>
</before>
<after>
<!-- Sign out Customer from storefront -->
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
<argument name="customerEmail" value="UKCustomer.email"/>
</actionGroup>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomersGridFilter"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
</after>

<!--Open Product page in StoreFront and assert product and price range -->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct">
<argument name="product" value="$simpleProduct$"/>
</actionGroup>

<!--Add product to the cart -->
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
<argument name="product" value="$simpleProduct$"/>
</actionGroup>

<!--Open View and edit -->
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openCartFromMiniCart"/>

<!-- Fill the Estimate Shipping and Tax section -->
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/>
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>

<!-- Fill the guest form -->
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestShippingAddress">
<argument name="customer" value="UKCustomer"/>
<argument name="customerAddress" value="updateCustomerUKAddress"/>
</actionGroup>
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping"/>
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToBillingStep"/>
<waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForSameBillingAndShippingAddressCheckboxVisible"/>
<uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/>
<conditionalClick selector="{{CheckoutShippingSection.editAddressButton}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditBillingAddressButton"/>

<!-- Fill Billing Address -->
<actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddressForm"/>
<click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateBillingAddressButton"/>

<!--Place order -->
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Register customer after checkout -->
<actionGroup ref="StorefrontRegisterCustomerAfterCheckoutActionGroup" stepKey="registerCustomer"/>

<!-- Open Order Page in admin -->
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
<argument name="orderId" value="{$orderId}"/>
</actionGroup>

<!-- Assert Grand Total -->
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$55.00" stepKey="seeGrandTotal"/>
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/>

<!-- Ship the order and assert the status -->
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/>
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/>

<!-- Assert order buttons -->
<actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest">
<test name="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest" deprecated="Use StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest instead">
<annotations>
<stories value="Checkout"/>
<title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
<title value="DEPRECATED. Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
<description value="Checkout as UK customer with different shipping/billing address and register checkout method"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14712"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="DEPRECATED">Use StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest instead</issueId>
</skip>
</annotations>

<before>
Expand Down
Loading

0 comments on commit 705769e

Please sign in to comment.