Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-devel…
Browse files Browse the repository at this point in the history
…op daily delivery

Accepted Community Pull Requests:
 - #27964: Deprecate AbstractAction and it's public methods (by @lbajsarowicz)
 - #27976: Can not create a subfolder with the same name as the main folder (by @engcom-Charlie)
 - #27515: #27503 : MFTF: Acceptance tests break the naming convention (Indexer + Backup) (by @konarshankar07)
 - #27994: Refactoring of the plugin responsible for the image/directory delete functionality + adjust tests (by @coderimus)
 - #26886: comments & validation added in cookie configuration (by @ajithkumar-maragathavel)
 - #27955: compliance to StorefrontMinicartSection (by @engcom-Echo)
  • Loading branch information
magento-engcom-team authored Apr 29, 2020
2 parents f442fa9 + 3ff32ab commit bb7e08f
Show file tree
Hide file tree
Showing 45 changed files with 343 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="deleteBackup">
<actionGroup name="AdminBackupDeleteActionGroup">
<annotations>
<description>Deletes a Backup using provided Backup Entity.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminBackupIndexPageOpenActionGroup">
<amOnPage url="{{AdminBackupIndexPage.url}}" stepKey="navigateToBackupIndexPage"/>
<waitForPageLoad stepKey="waitForBackupIndexPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="deleteBackup" extends="AdminBackupDeleteActionGroup" deprecated="Use DeleteBackupActionGroup"/>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="BackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<page name="AdminBackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
<section name="AdminMainActionsSection"/>
<section name="AdminGridTableSection"/>
<section name="AdminCreateBackupFormSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!--Go to backup index page-->
<amOnPage url="{{BackupIndexPage.url}}" stepKey="goToBackupPage"/>
<waitForPageLoad stepKey="waitForBackupPage"/>
<actionGroup ref="AdminBackupIndexPageOpenActionGroup" stepKey="navigateToBackupPage"/>

<!--Create system backup-->
<actionGroup ref="CreateSystemBackupActionGroup" stepKey="createSystemBackup"/>
Expand All @@ -39,17 +38,17 @@
<actionGroup ref="CreateDatabaseBackupActionGroup" stepKey="createDatabaseBackup"/>

<!--Delete system backup-->
<actionGroup ref="deleteBackup" stepKey="deleteSystemBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteSystemBackup">
<argument name="backup" value="SystemBackup"/>
</actionGroup>

<!--Delete database/media backup-->
<actionGroup ref="deleteBackup" stepKey="deleteMediaBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteMediaBackup">
<argument name="backup" value="MediaBackup"/>
</actionGroup>

<!--Delete database backup-->
<actionGroup ref="deleteBackup" stepKey="deleteDatabaseBackup">
<actionGroup ref="AdminBackupDeleteActionGroup" stepKey="deleteDatabaseBackup">
<argument name="backup" value="DatabaseBackup"/>
</actionGroup>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<see selector="{{StorefrontMinicartSection.productPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPrice1"/>

<!-- Assert that the rule isn't present on the Checkout page -->
<click selector="{{StorefrontMiniCartSection.goToCheckout}}" stepKey="goToCheckout1"/>
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout1"/>
<conditionalClick selector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" dependentSelector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" visible="true" stepKey="expandShoppingCartSummary1"/>
<see selector="{{CheckoutCartProductSection.ProductRegularPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPriceOnCheckout1"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<element name="itemDiscount" type="text" selector="//tr[@class='totals']//td[@class='amount']/span"/>
<element name="subtotal" type="text" selector="//tr[@class='totals sub']//td[@class='amount']/span"/>
<element name="emptyCart" type="text" selector=".counter.qty.empty"/>
<element name="emptyMiniCart" type="text" selector="//div[@class='minicart-wrapper']//span[@class='counter qty empty']/../.."/>
<element name="minicartContent" type="block" selector="#minicart-content-wrapper"/>
<element name="messageEmptyCart" type="text" selector="//*[@id='minicart-content-wrapper']//*[contains(@class,'subtitle empty')]"/>
<element name="visibleItemsCountText" type="text" selector="//div[@class='items-total']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

<!-- Verify mini cart is empty -->
<actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="assertEmptryCart">
<argument name="selector" value="{{StorefrontMiniCartSection.emptyMiniCart}}"/>
<argument name="selector" value="{{StorefrontMinicartSection.emptyMiniCart}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert Empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Register customer after checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

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

<!-- Register customer after checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</actionGroup>

<!-- Check cart -->
<click selector="{{StorefrontMiniCartSection.show}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMiniCartSection.quantity}}" stepKey="dontSeeCartItem"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>

<!-- Login to Admin Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>

<!-- Assert empty Mini Cart -->
<seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>

<!-- Open Order Index Page -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillCookieLifetimeActionGroup">
<annotations>
<description>Fills the cookie lifetime field with sample data.</description>
</annotations>
<arguments>
<argument name="cookieLifetime" type="string"/>
</arguments>
<fillField selector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" userInput="{{cookieLifetime}}" stepKey="fillFieldCookieLifetime"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminNavigateToDefaultCookieSettingsActionGroup">
<amOnPage url="{{AdminConfigurationDefaultCookieSettingsPage.url}}" stepKey="navigateToDefaultCookieSettings"/>
<waitForPageLoad stepKey="waitForWebConfigurationPageLoad"/>
<scrollTo selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" x="-150" y="-150" stepKey="scrollToDefaultCookieSettingsSection"/>
<conditionalClick stepKey="expandDefaultCookieSettingsTab" selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" dependentSelector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" visible="false"/>
<waitForElementVisible selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" stepKey="waitForElementsAppeared"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminConfigurationDefaultCookieSettingsPage" url="admin/system_config/edit/section/web/" module="Cookie" area="admin">
<section name="AdminDefaultCookieSettingsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminDefaultCookieSettingsSection">
<element name="DefaultCookieSettingsTab" type="button" selector="#web_cookie-head"/>
<element name="DefaultCookieLifetime" type="input" selector="#web_cookie_cookie_lifetime"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?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="AdminValidateCookieLifetimeTest">
<annotations>
<features value="Cookie"/>
<stories value="Validate cookie lifetime field in Magento admin"/>
<title value="Admin should not able to enter text in cookie lifetime filed"/>
<description value="Admin can only be able type numbers in cookie lifetime filed in Magento admin"/>
<group value="Cookie"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
</after>
<actionGroup ref="AdminNavigateToDefaultCookieSettingsActionGroup" stepKey="navigateToDefaultCookieSettingsPage"/>
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
<argument name="rowId" value="row_web_cookie_cookie_lifetime"/>
</actionGroup>
<actionGroup ref="AdminFillCookieLifetimeActionGroup" stepKey="fillCookieLifetimeField">
<argument name="cookieLifetime" value="cookie"/>
</actionGroup>
<actionGroup ref="AdminClickFormActionButtonActionGroup" stepKey="clickSaveButtonWithString">
<argument name="buttonSelector" value="{{AdminMainActionsSection.save}}"/>
</actionGroup>
<actionGroup ref="AssertAdminValidationErrorActionGroup" stepKey="assertNumberValidation">
<argument name="inputId" value="web_cookie_cookie_lifetime"/>
<argument name="errorMessage" value="Please enter a valid number in this field."/>
</actionGroup>
<actionGroup ref="AdminFillCookieLifetimeActionGroup" stepKey="fillCookieLifetimeFieldWithNumber">
<argument name="cookieLifetime" value="3600"/>
</actionGroup>
<actionGroup ref="AdminCheckUseSystemValueActionGroup" stepKey="checkUseSystemValue">
<argument name="rowId" value="row_web_cookie_cookie_lifetime"/>
</actionGroup>
<actionGroup ref="AdminClickFormActionButtonActionGroup" stepKey="clickSaveButtonWithNumber">
<argument name="buttonSelector" value="{{AdminMainActionsSection.save}}"/>
</actionGroup>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveCookieLifetimeSuccessMessage">
<argument name="message" value="You saved the configuration."/>
<argument name="messageType" value="success"/>
</actionGroup>
</test>
</tests>
Loading

0 comments on commit bb7e08f

Please sign in to comment.