Skip to content

Commit

Permalink
Merge pull request #6147 from magento-tsg/2.4-develop-pr86
Browse files Browse the repository at this point in the history
[TSG] Fixes for 2.4 (pr86) (2.4-develop)
  • Loading branch information
zakdma committed Sep 17, 2020
2 parents b9c13fd + bf6e34a commit 57c527e
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 8 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
@@ -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
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ define([
* @param {Object} data - customer address
*/
deleteMassaction: function (data) {
var ids = _.map(data, function (val) {
var ids = data.selected || this.selections().selected();

ids = _.map(ids, function (val) {
return parseFloat(val);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
<imports>true</imports>
</dataLinks>
<externalProvider>customer_address_listing.customer_address_listing_data_source</externalProvider>
<selectionsProvider>customer_address_listing.customer_address_listing.customer_address_listing_columns.ids</selectionsProvider>
<selectionsProvider>customer_address_listing.customer_address_listing.customer_address_columns.ids</selectionsProvider>
<autoRender>true</autoRender>
<dataScope>customer_address_listing</dataScope>
<ns>customer_address_listing</ns>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/* eslint-disable max-nested-callbacks */
/*jscs:disable jsDoc*/
define(['Magento_Customer/js/form/components/insert-listing'], function (Constr) {
'use strict';

describe('Magento_Customer/js/form/components/insert-listing', function () {
var obj,
ids = ['1', '2'],
data = {
action: 'delete',
data: {
selected: ids
}
},
selectionsProvider = {
selected: jasmine.createSpy().and.returnValue(ids)
};

beforeEach(function () {
obj = new Constr({
name: 'content_name',
selections: function () {
return selectionsProvider;
}
});
});

describe('Check delete massaction process', function () {
it('Check call to deleteMassaction method', function () {
obj.deleteMassaction = {
call: jasmine.createSpy()
};
obj.onMassAction(data);

expect(obj.deleteMassaction.call).toHaveBeenCalledWith(obj, {
selected: ids
});
});

it('Check ids are retrieved from selections provider if they are NOT in data', function () {
obj._delete = jasmine.createSpy();
obj.onMassAction({
action: 'delete',
data: {}
});

expect(selectionsProvider.selected).toHaveBeenCalled();
selectionsProvider.selected.calls.reset();
expect(obj._delete).toHaveBeenCalledWith([1, 2]);
});

it('Check removal of default addresses', function () {
obj.source = {
get: jasmine.createSpy().and.returnValues(2, 3),
set: jasmine.createSpy()
};
obj.onMassAction(data);

expect(selectionsProvider.selected).not.toHaveBeenCalled();
expect(obj.source.get.calls.count()).toEqual(2);
expect(obj.source.set.calls.count()).toEqual(1);
});
});
});
});

0 comments on commit 57c527e

Please sign in to comment.