Skip to content

Commit 9e68cbf

Browse files
Merge remote-tracking branch 'mainline/2.3-develop' into EPAM-PR-85
2 parents 27e3b1b + 67f525d commit 9e68cbf

File tree

106 files changed

+2871
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2871
-194
lines changed

app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="adminNoReportRole" type="user_role">
12+
<data key="all">0</data>
1213
<data key="rolename" unique="suffix">noreport</data>
1314
<data key="current_password">123123q</data>
1415
<array key="resource">
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertAdminUserIsInGridActionGroup">
12+
<arguments>
13+
<argument name="user" type="entity"/>
14+
</arguments>
15+
<click selector="{{AdminUserGridSection.resetButton}}" stepKey="resetGridFilter"/>
16+
<waitForPageLoad stepKey="waitForFiltersReset" time="15"/>
17+
<fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/>
18+
<click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/>
19+
<waitForPageLoad stepKey="waitForGridToLoad" time="15"/>
20+
<see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/>
21+
</actionGroup>
22+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertUserRoleRestrictedAccessActionGroup">
12+
<see selector="{{AdminHeaderSection.pageHeading}}" userInput="Sorry, you need permissions to view this content." stepKey="seeErrorMessage"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/CookieConfigData.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,20 @@
2020
<data key="scope_code">base</data>
2121
<data key="value">''</data>
2222
</entity>
23+
<entity name="ChangeWebCookieLifetimeConfigData">
24+
<data key="path">web/cookie/cookie_lifetime</data>
25+
<data key="value">60</data>
26+
</entity>
27+
<entity name="DefaultWebCookieLifetimeConfigData">
28+
<data key="path">web/cookie/cookie_lifetime</data>
29+
<data key="value">3600</data>
30+
</entity>
31+
<entity name="ChangeAdminSecuritySessionLifetimeConfigData">
32+
<data key="path">admin/security/session_lifetime</data>
33+
<data key="value">60</data>
34+
</entity>
35+
<entity name="DefaultAdminSecuritySessionLifetimeConfigData">
36+
<data key="path">admin/security/session_lifetime</data>
37+
<data key="value">7200</data>
38+
</entity>
2339
</entities>

app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="password" type="input" selector="#login"/>
1414
<element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/>
1515
<element name="forgotPasswordLink" type="button" selector=".action-forgotpassword" timeout="10"/>
16+
<element name="loginBlock" type="block" selector=".adminhtml-auth-login"/>
1617
</section>
1718
</sections>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="AdminExpireAdminSessionTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Admin Session Expire"/>
15+
<title value="Admin Session Expire"/>
16+
<description value="Admin Session Expire"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-14111"/>
19+
<group value="Backend"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<after>
23+
<!-- 4. Restore default configuration settings. -->
24+
<magentoCLI command="config:set {{DefaultAdminSecuritySessionLifetimeConfigData.path}} {{DefaultAdminSecuritySessionLifetimeConfigData.value}}" stepKey="setDefaultSessionLifetime"/>
25+
</after>
26+
<!-- 1. Apply configuration settings. -->
27+
<magentoCLI command="config:set {{ChangeAdminSecuritySessionLifetimeConfigData.path}} {{ChangeAdminSecuritySessionLifetimeConfigData.value}}" stepKey="changeCookieLifetime"/>
28+
29+
<!-- 2. Wait for session to expire. -->
30+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
31+
<wait time="60" stepKey="waitForSessionLifetime"/>
32+
<reloadPage stepKey="reloadPage"/>
33+
34+
<!-- 3. Perform asserts. -->
35+
<seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/>
36+
</test>
37+
</tests>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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="AdminExpireCustomerSessionTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Customer Session Expire"/>
15+
<title value="Customer Session Expireon"/>
16+
<description value="Customer Session Expire"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-14110"/>
19+
<group value="Backend"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<after>
23+
<!-- 6. Restore default configuration settings. -->
24+
<magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/>
25+
<!-- Delete data -->
26+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
</after>
29+
<!-- 1. Login to Admin. -->
30+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
31+
32+
<!-- 2. Create customer if needed. -->
33+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
34+
35+
<!-- 3. Apply configuration settings. -->
36+
<magentoCLI command="config:set {{ChangeWebCookieLifetimeConfigData.path}} {{ChangeWebCookieLifetimeConfigData.value}}" stepKey="changeCookieLifetime"/>
37+
38+
<!-- 4. Wait for session to expire. -->
39+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
40+
<argument name="Customer" value="$$createCustomer$$" />
41+
</actionGroup>
42+
<wait time="60" stepKey="waitForCookieLifetime"/>
43+
<reloadPage stepKey="reloadPage"/>
44+
45+
<!-- 5. Perform asserts. -->
46+
<seeElement selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" stepKey="assertAuthorizationLinkIsVisibleOnStoreFront"/>
47+
</test>
48+
</tests>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ public function execute()
8989
['fileId' => 'image']
9090
);
9191
$uploader->setAllowedExtensions($this->getAllowedExtensions());
92-
93-
if (!$uploader->checkMimeType($this->getAllowedMimeTypes())) {
94-
throw new LocalizedException(__('Disallowed File Type.'));
95-
}
96-
9792
$imageAdapter = $this->adapterFactory->create();
9893
$uploader->addValidateCallback('catalog_product_image', $imageAdapter, 'validateUploadFile');
9994
$uploader->setAllowRenameFiles(true);
@@ -133,14 +128,4 @@ private function getAllowedExtensions()
133128
{
134129
return array_keys($this->allowedMimeTypes);
135130
}
136-
137-
/**
138-
* Get the set of allowed mime types.
139-
*
140-
* @return array
141-
*/
142-
private function getAllowedMimeTypes()
143-
{
144-
return array_values($this->allowedMimeTypes);
145-
}
146131
}

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@
1818
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
1919
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
2020
</actionGroup>
21+
22+
<!-- ActionGroup click on Advanced Inventory Button in product form;
23+
You must already be on the product form page -->
24+
<actionGroup name="AdminClickOnAdvancedInventoryButtonActionGroup">
25+
<annotations>
26+
<description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description>
27+
</annotations>
28+
29+
<click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/>
30+
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
31+
</actionGroup>
2132
</actionGroups>
Lines changed: 20 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminProductStockStatusActionGroup">
11+
<arguments>
12+
<argument name="productId" type="string"/>
13+
<argument name="stockStatus" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProductEditPage"/>
16+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
17+
<seeOptionIsSelected selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}"
18+
stepKey="checkProductStatus"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)