Skip to content

Commit 37be269

Browse files
author
Stanislav Idolov
authored
Merge pull request #6442 from magento-engcom/engcom-regression-bugfixes
[EngCom] Regression bugfixes (MC-39761, MC-39561 & MC-39811)
2 parents 057c268 + 69b50f7 commit 37be269

File tree

8 files changed

+258
-2
lines changed

8 files changed

+258
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup">
12+
<annotations>
13+
<description>Verify "Allow remote shopping assistance" checkbox present on page and checked.</description>
14+
</annotations>
15+
16+
<waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/>
17+
<seeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}"
18+
stepKey="assertAllowAssistanceCheckboxChecked"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup">
12+
<annotations>
13+
<description>Verify "Allow remote shopping assistance" checkbox present on page and unchecked.</description>
14+
</annotations>
15+
16+
<waitForElement selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}" stepKey="waitForAllowAssistanceCheckbox"/>
17+
<dontSeeCheckboxIsChecked selector="{{StorefrontCustomerAccountInformationSection.allowAssistance}}"
18+
stepKey="assertAllowAssistanceCheckboxUnchecked"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerAccountInformationSection">
12+
<element name="allowAssistance" type="checkbox" selector=".form-edit-account input[name='assistance_allowed_checkbox']"/>
13+
</section>
14+
</sections>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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="AdminLoginAsCustomerAssistanceCheckboxTest">
12+
<annotations>
13+
<features value="Login as Customer"/>
14+
<stories value="Opt in/out"/>
15+
<title value="Login as Customer assistance checkbox test"/>
16+
<description
17+
value="Verify that 'Allow remote shopping assistance' checkbox is present on Edit Account Information page"/>
18+
<severity value="CRITICAL"/>
19+
<group value="login_as_customer"/>
20+
</annotations>
21+
<before>
22+
<magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1"
23+
stepKey="enableLoginAsCustomer"/>
24+
<magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0"
25+
stepKey="enableLoginAsCustomerAutoDetection"/>
26+
<createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/>
27+
<createData entity="Simple_US_Customer" stepKey="createSecondCustomer"/>
28+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/>
32+
<deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/>
33+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/>
34+
</after>
35+
<!-- Login into First Customer account -->
36+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsFirstCustomer">
37+
<argument name="Customer" value="$createFirstCustomer$"/>
38+
</actionGroup>
39+
40+
<!-- Open My Account > Order by SKU -->
41+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToFirstMyAccountPage"/>
42+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openFirstAccountInformation">
43+
<argument name="menu" value="Account Information"/>
44+
</actionGroup>
45+
46+
<!-- Assert Assistance checkbox is present and checked -->
47+
<actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxCheckedActionGroup"
48+
stepKey="assertAssistanceAllowedCheckboxChecked"/>
49+
50+
<!-- Logout customer -->
51+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFirstCustomer"/>
52+
53+
<!-- Login into Second Customer account -->
54+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsSecondCustomer">
55+
<argument name="Customer" value="$createSecondCustomer$"/>
56+
</actionGroup>
57+
58+
<!-- Open My Account > Order by SKU -->
59+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToSecondMyAccountPage"/>
60+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openSecondAccountInformation">
61+
<argument name="menu" value="Account Information"/>
62+
</actionGroup>
63+
64+
<!-- Assert Assistance checkbox is present and unchecked -->
65+
<actionGroup ref="StorefrontAssertLoginAssistanceAllowedCheckboxUncheckedActionGroup"
66+
stepKey="assertAssistanceAllowedCheckboxUnchecked"/>
67+
</test>
68+
</tests>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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="StorefrontAddBundleProductToWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Add bundle product to wishlist"/>
15+
<description value="Add Bundle Product to Wishlist and verify Bundle Options are preserved"/>
16+
<severity value="CRITICAL"/>
17+
<group value="wishlist"/>
18+
</annotations>
19+
<before>
20+
<!-- Create Data -->
21+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
24+
<field key="price">100.00</field>
25+
</createData>
26+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
27+
<field key="price">20.00</field>
28+
</createData>
29+
<!--Create Bundle product-->
30+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
34+
<requiredEntity createDataKey="createBundleProduct"/>
35+
</createData>
36+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
<requiredEntity createDataKey="createBundleOption1_1"/>
39+
<requiredEntity createDataKey="simpleProduct1"/>
40+
</createData>
41+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
42+
<requiredEntity createDataKey="createBundleProduct"/>
43+
<requiredEntity createDataKey="createBundleOption1_1"/>
44+
<requiredEntity createDataKey="simpleProduct2"/>
45+
</createData>
46+
47+
<magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/>
48+
</before>
49+
<after>
50+
<!-- Delete data -->
51+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
52+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
53+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
54+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
55+
<deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/>
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
57+
</after>
58+
59+
<!-- 1. Login as a customer -->
60+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
61+
<argument name="Customer" value="$$createCustomer$$"/>
62+
</actionGroup>
63+
64+
<!-- Open Product page -->
65+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
66+
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
67+
</actionGroup>
68+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/>
69+
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/>
70+
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/>
71+
72+
<!-- Add product to the wishlist -->
73+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist">
74+
<argument name="productVar" value="$$createBundleProduct$$"/>
75+
</actionGroup>
76+
77+
<!-- Assert product is present in wishlist -->
78+
<actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent">
79+
<argument name="productName" value="$$createBundleProduct.name$$"/>
80+
<argument name="productPrice" value="$100.00"/>
81+
</actionGroup>
82+
83+
<!-- Assert product details in wishlist -->
84+
<actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails">
85+
<argument name="productName" value="$$createBundleProduct.name$$"/>
86+
<argument name="label" value="$$createBundleOption1_1.title$$"/>
87+
<argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/>
88+
</actionGroup>
89+
90+
<!-- Assert product cart is empty -->
91+
<actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/>
92+
</test>
93+
</tests>

app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ define([
144144
return productListWrapper.find(this.options.actionElement);
145145
}
146146

147-
return $(event.currentTarget).closest(this.options.productPageWrapper).find(this.options.actionElement);
147+
return $(this.options.productPageWrapper).find(this.options.actionElement);
148148
},
149149

150150
/**

dev/tests/setup-integration/etc/di/preferences/cli/ce.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
use Magento\Framework as MF;
8+
use Magento\TestFramework as TF;
9+
710
return [
8-
'\Magento\Framework\Mview\TriggerCleaner' => '\Magento\TestFramework\Mview\DummyTriggerCleaner',
11+
MF\App\AreaList::class => TF\App\AreaList::class,
12+
MF\Mview\TriggerCleaner::class => TF\Mview\DummyTriggerCleaner::class,
913
];
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\TestFramework\App;
9+
10+
use Magento\Framework\App\Area\FrontNameResolverFactory;
11+
use Magento\Framework\ObjectManagerInterface;
12+
13+
/**
14+
* Stub for \Magento\Framework\App\AreaList
15+
*/
16+
class AreaList extends \Magento\Framework\App\AreaList
17+
{
18+
/**
19+
* @param ObjectManagerInterface $objectManager
20+
* @param FrontNameResolverFactory $resolverFactory
21+
* @param array $areas
22+
* @param string|null $default
23+
*/
24+
public function __construct(
25+
ObjectManagerInterface $objectManager,
26+
FrontNameResolverFactory $resolverFactory,
27+
array $areas = [],
28+
$default = null
29+
) {
30+
parent::__construct($objectManager, $resolverFactory, $areas, $default);
31+
/**
32+
* Then Magento is installed for setup-integration tests, di.xml files are parsed from all Magento modules,
33+
* causing Magento\Framework\App\AreaList _areas property to be filled with arguments from disabled modules.
34+
*/
35+
$this->_areas = [];
36+
}
37+
}

0 commit comments

Comments
 (0)